[dwarf reader] Do not over de-duplicate function *definitions*
authorDodji Seketeli <dodji@redhat.com>
Fri, 13 Jan 2017 23:06:19 +0000 (00:06 +0100)
committerDodji Seketeli <dodji@redhat.com>
Mon, 16 Jan 2017 20:00:54 +0000 (21:00 +0100)
When a function needs to be completed, we sometimes wrongly
try to de-duplicate rather than just complete it.

* src/abg-dwarf-reader.cc
(build_or_get_fn_decl_if_not_suppressed): Do try to de-duplicate a
function if it's to be completed.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-dwarf-reader.cc

index 1396dbc2a51f9a8da0587e5e6075cda5c88b2155..352737450603b148f821c30fe3e673d6fe2700a6 100644 (file)
@@ -12291,12 +12291,13 @@ build_or_get_fn_decl_if_not_suppressed(read_context&    ctxt,
   if (function_is_suppressed(ctxt, scope, fn_die))
     return fn;
 
-  if ((fn = is_function_decl(ctxt.lookup_artifact_from_die(fn_die,
-                                                          where_offset))))
-    {
-      ctxt.associate_die_to_decl(fn_die, fn, /*do_associate_by_repr=*/true);
-      return fn;
-    }
+  if (!result)
+    if ((fn = is_function_decl(ctxt.lookup_artifact_from_die(fn_die,
+                                                            where_offset))))
+      {
+       ctxt.associate_die_to_decl(fn_die, fn, /*do_associate_by_repr=*/true);
+       return fn;
+      }
 
   fn = build_function_decl(ctxt, fn_die, where_offset, result);