aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index e36177a..9723ddd 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -6234,6 +6234,18 @@ read_attribute_value (struct attribute *attr, unsigned form,
dwarf_form_name (form),
bfd_get_filename (abfd));
}
+
+ /* We have seen instances where the compiler tried to emit a byte
+ size attribute of -1 which ended up being encoded as an unsigned
+ 0xffffffff. Although 0xffffffff is technically a valid size value,
+ an object of this size seems pretty unlikely so we can relatively
+ safely treat these cases as if the size attribute was invalid and
+ treat them as zero by default. */
+ if (attr->name == DW_AT_byte_size
+ && form == DW_FORM_data4
+ && DW_UNSND (attr) >= 0xffffffff)
+ DW_UNSND (attr) = 0;
+
return info_ptr;
}