@@ -195,15 +195,21 @@ def process_statement(self, kind, level, data, statement_id):
195195
196196 # If it's just a forward declaration, we want the name around,
197197 # but there won't be a size
198- if 'DW_AT_declaration' not in data and 'DW_AT_byte_size' in data :
199- self .vtypes [name ] = [ int (data ['DW_AT_byte_size' ], self .base ), {} ]
198+ if 'DW_AT_declaration' not in data :
199+ if 'DW_AT_byte_size' in data :
200+ self .vtypes [name ] = [ int (data ['DW_AT_byte_size' ], self .base ), {} ]
201+ else :
202+ self .vtypes [name ] = [ 0 , {} ]
200203
201204 elif kind == 'DW_TAG_union_type' :
202205 name = data .get ('DW_AT_name' , "__unnamed_%s" % statement_id ).strip ('"' )
203206 self .name_stack [- 1 ][1 ] = name
204207 self .id_to_name [statement_id ] = [name ]
205- if 'DW_AT_declaration' not in data and 'DW_AT_byte_size' in data :
206- self .vtypes [name ] = [ int (data ['DW_AT_byte_size' ], self .base ), {} ]
208+ if 'DW_AT_declaration' not in data :
209+ if 'DW_AT_byte_size' in data :
210+ self .vtypes [name ] = [ int (data ['DW_AT_byte_size' ], self .base ), {} ]
211+ else :
212+ self .vtypes [name ] = [ 0 , {} ]
207213
208214 elif kind == 'DW_TAG_array_type' :
209215 self .name_stack [- 1 ][1 ] = statement_id
@@ -216,8 +222,12 @@ def process_statement(self, kind, level, data, statement_id):
216222
217223 # If it's just a forward declaration, we want the name around,
218224 # but there won't be a size
219- if 'DW_AT_declaration' not in data and 'DW_AT_byte_size' in data :
220- sz = int (data ['DW_AT_byte_size' ], self .base )
225+ if 'DW_AT_declaration' not in data :
226+ if 'DW_AT_byte_size' in data :
227+ sz = int (data ['DW_AT_byte_size' ], self .base )
228+ else :
229+ sz = 0
230+
221231 self .enums [name ] = [sz , {}]
222232
223233 elif kind == 'DW_TAG_pointer_type' :
0 commit comments