]> sourceware.org Git - libabigail.git/commitdiff
Fix accidentally removing the scope of variables when fixing them up
authorDodji Seketeli <dodji@redhat.com>
Thu, 11 Dec 2014 10:32:09 +0000 (11:32 +0100)
committerDodji Seketeli <dodji@redhat.com>
Thu, 11 Dec 2014 10:39:31 +0000 (11:39 +0100)
This is about bug
https://sourceware.org/bugzilla/show_bug.cgi?id=17652.  Some old DWARF
producers emit incomplete debug info for static data members.  We
currently detect this and fix the resulting constructed variables up.
During this fix up, it appears that we sometimes accidentally remove
the scope of some variables.  Fixed thus.

* src/abg-dwarf-reader.cc (build_translation_unit_and_add_to_ir):
During var decl fixup, remove the scope of a variable only when we
are sure that we want to re-scope it.

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

index 4f698dfcdc0dbb4b32fee28c34bf82f7b5f1156e..36b16c1396a09b98c636f31c5d5306aa2e6c081d 100644 (file)
@@ -5037,17 +5037,19 @@ build_translation_unit_and_add_to_ir(read_context&      ctxt,
                // variable declaration DIE.  Thus remove the global
                // variable definition from its current non-class
                // scope ...
-               remove_decl_from_scope(*v);
                decl_base_sptr d;
                if (d = lookup_var_decl_in_scope(mem_name,cl))
                  // This is the data member with the same name in cl.
-                 // We need to flag it as static.
+                 // We just need to flag it as static.
                  ;
                else
-                 // In this case there is no data member with the
-                 // same name in cl already.  Let's add it there then
-                 // ...
-                 d = add_decl_to_scope(*v, cl);
+                 {
+                   // In this case there is no data member with the
+                   // same name in cl already.  Let's add it there then
+                   // ...
+                   remove_decl_from_scope(*v);
+                   d = add_decl_to_scope(*v, cl);
+                 }
 
                assert(dynamic_pointer_cast<var_decl>(d));
                // Let's flag the data member as static.
This page took 0.036749 seconds and 5 git commands to generate.