mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 09:38:57 +00:00
Fix segfault when creating builtin types
Sanity check the existence of a type field before dereferencing it.
This commit is contained in:
@@ -5732,8 +5732,9 @@ append_composite_type_field_raw (struct type *t, const char *name,
|
||||
f[0].set_type (field);
|
||||
FIELD_NAME (f[0]) = name;
|
||||
|
||||
if (field->contains_capability ()
|
||||
|| field->code () == TYPE_CODE_CAPABILITY)
|
||||
if (field != nullptr
|
||||
&& (field->contains_capability ()
|
||||
|| field->code () == TYPE_CODE_CAPABILITY))
|
||||
t->set_contains_capability (true);
|
||||
|
||||
return f;
|
||||
|
||||
Reference in New Issue
Block a user