if (sibling_addr != 0)
{
if (abbr_code == 0)
- wr_error (&where,
- ": is the last sibling in chain, "
- "but has a DW_AT_sibling attribute.\n");
+ {
+ DEF_PREV_WHERE;
+ wr_error (&prev_where,
+ ": is the last sibling in chain, "
+ "but has a DW_AT_sibling attribute.\n");
+ /* dwarf_siblingof uses DW_AT_sibling to look for
+ sibling DIEs. The value can't be right (there _is_
+ no sibling), so don't let this up. */
+ retval = -2;
+ }
else if (sibling_addr != die_off)
{
DEF_PREV_WHERE;
testfiles hello.bad-1 hello.bad-3 empty-1 \
garbage-1 garbage-2 garbage-3 garbage-4 \
- garbage-5 garbage-6 garbage-7 garbage-8
+ garbage-5 garbage-6 garbage-7 garbage-8 \
+ garbage-9
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-8 <<EOF
error: .debug_info: DIE 0x6c (abbr. attribute 0x43): DW_AT_sibling with a value of 0.
EOF
+
+testrun_compare ./dwarflint garbage-9 <<EOF
+error: .debug_info: DIE 0x84 (abbr. attribute 0x5f): invalid reference outside the CU: 0xef00ab.
+error: .debug_info: DIE 0x6c: is the last sibling in chain, but has a DW_AT_sibling attribute.
+EOF