From: Hannes Domani Date: Tue, 6 Oct 2020 15:08:42 +0000 (+0200) Subject: Don't create _Complex type name if there is no target type name X-Git-Tag: gdb-10.1-release~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7565d82a500dc084347db7e472d73ef38872b1dc;p=thirdparty%2Fbinutils-gdb.git Don't create _Complex type name if there is no target type name This causes gdb to crash in strlen. Happens if init_complex_type is called for a type created by dbx_init_float_type in stabsread.c. gdb/ChangeLog: 2020-10-22 Hannes Domani * gdbtypes.c (init_complex_type): Check target type name. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4358b449856..4baafd41094 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2020-10-22 Hannes Domani + + * gdbtypes.c (init_complex_type): Check target type name. + 2020-10-22 Simon Marchi PR gdb/26693 diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index b7c8ec8e643..a40ae5f30eb 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -3283,7 +3283,7 @@ init_complex_type (const char *name, struct type *target_type) if (TYPE_MAIN_TYPE (target_type)->flds_bnds.complex_type == nullptr) { - if (name == nullptr) + if (name == nullptr && target_type->name () != nullptr) { char *new_name = (char *) TYPE_ALLOC (target_type,