Make "ocamlopt -g" more resistant to ill-formed locations
authorXavier Leroy <xavier.leroy@inria.fr>
Thu, 28 Nov 2013 14:31:42 +0000 (14:31 +0000)
committerStéphane Glondu <glondu@debian.org>
Thu, 30 Oct 2014 08:28:06 +0000 (08:28 +0000)
Origin: upstream SVN, r1432
Bug: http://caml.inria.fr/mantis/view.php?id=6243

Gbp-Pq: Name 0016-Make-ocamlopt-g-more-resistant-to-ill-formed-locatio.patch

asmcomp/emitaux.ml

index 3ad467cbff99ca67c4806c817d886d6404f6890b..ccfa977ffae603d6c66038d62060c9e85fe822e0 100644 (file)
@@ -221,9 +221,9 @@ let reset_debug_info () =
 let emit_debug_info dbg =
   if is_cfi_enabled () &&
     (!Clflags.debug || Config.with_frame_pointers)
-     && not (Debuginfo.is_none dbg) then begin
+     && dbg.Debuginfo.dinfo_line > 0 (* PR#6243 *)
+  then begin
     let line = dbg.Debuginfo.dinfo_line in
-    assert (line <> 0); (* clang errors out on zero line numbers *)
     let file_name = dbg.Debuginfo.dinfo_file in
     let file_num =
       try List.assoc file_name !file_pos_nums