From bd7272f365e8465417517ba8155154a5d6457219 Mon Sep 17 00:00:00 2001 From: Juraj Oravec Date: Thu, 30 May 2024 21:57:02 +0200 Subject: [PATCH] Fix crash when parsing array Signed-off-by: Juraj Oravec --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 081150a..380a2dc 100644 --- a/main.py +++ b/main.py @@ -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 = []