]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: We should not let the abbrev code 0 propagate up
authorPetr Machata <pmachata@redhat.com>
Tue, 8 Mar 2011 19:09:14 +0000 (20:09 +0100)
committerPetr Machata <pmachata@redhat.com>
Tue, 8 Mar 2011 19:09:14 +0000 (20:09 +0100)
dwarflint/check_debug_abbrev.cc
dwarflint/tests/run-bad.sh

index f2383319fe9745739c497b2ef1247ef80fadd5ff..dd907e5096a7fb2ee3b4a4e88e5f3177cc8049c1 100644 (file)
@@ -381,6 +381,15 @@ namespace
              break;
 
            /* Otherwise validate name and form.  */
+           if (attrib_name == 0)
+             {
+               wr_error (where) << "invalid attribute code 0." << std::endl;
+               // We can handle this, so keep going.  But this is not
+               // kosher for high-level checks.
+               failed = true;
+               continue;
+             }
+
            attribute = ver->get_attribute (attrib_name);
            if (attribute == NULL)
              {
index 38b9be1a3294ddb7801f0348249c0e1c0521725c..0219340edffed8b3d2e49549bb6cee63060563d4 100755 (executable)
@@ -52,5 +52,5 @@ error: .debug_info: CU 0: toplevel DIE must be either compile_unit or partial_un
 EOF
 
 testrun_compare ./dwarflint --check=@low garbage-3 <<EOF
-error: .debug_abbrev: abbr. attribute 0xc: invalid or unknown name 0x0.
+error: .debug_abbrev: abbr. attribute 0xc: invalid attribute code 0.
 EOF