- this to allow (certainly bogus, but anyway) attribute name == 0
- test case that triggers this
/* Attribute values. */
for (struct abbrev_attrib *it = abbrev->attribs;
- it->name != 0; ++it)
+ it->name != 0 || it->form != 0; ++it)
{
where.ref = &it->where;
if (!it->second.abbr[i].used)
wr_message (it->second.abbr[i].where,
cat (mc_impact_3, mc_acc_bloat, mc_abbrevs))
- << ": abbreviation is never used." << std::endl;
+ << "abbreviation is never used." << std::endl;
}
// re-link CUs so that they form a chain again. This is to
srcdir=$srcdir/tests
-testfiles hello.bad-1 hello.bad-3 garbage-1 garbage-2
+testfiles hello.bad-1 hello.bad-3 garbage-1 garbage-2 garbage-3
testrun_compare ./dwarflint hello.bad-1 <<EOF
error: .debug_info: DIE 0x83: abbrev section at 0x0 doesn't contain code 83.
testrun_compare ./dwarflint garbage-2 <<EOF
error: .debug_info: CU 0: toplevel DIE must be either compile_unit or partial_unit.
EOF
+
+testrun_compare ./dwarflint --check=@low garbage-3 <<EOF
+error: .debug_abbrev: abbr. attribute 0xc: invalid or unknown name 0x0.
+EOF