Fix crash when parsing array

Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
Juraj Oravec 2024-05-30 21:57:02 +02:00
parent e1be4b7e6a
commit bd7272f365
Signed by: SGOrava
GPG Key ID: 13660A3F1D9F093B

View File

@ -229,7 +229,9 @@ class Bear():
elif die_type.tag == 'DW_TAG_array_type':
self.truly_resolve_type(entry, die_type.get_DIE_from_attribute('DW_AT_type'))
load_children(die_type)
entry['number_of_elements'] = die_type._children[0].attributes['DW_AT_upper_bound'].value + 1
if 'DW_AT_upper_bound' in die_type._children[0].attributes:
entry['number_of_elements'] = die_type._children[0].attributes['DW_AT_upper_bound'].value + 1
elif die_type.tag == 'DW_TAG_union_type':
load_children(die_type)
child_entries = []