From: Doug Evans Date: Wed, 11 Feb 2015 05:18:59 +0000 (-0800) Subject: internal_type_self_type: Handle TYPE_SPECIFIC_NONE. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eaaf76abdc6444e07860067e01c8135303a429ca;p=binutils-gdb.git internal_type_self_type: Handle TYPE_SPECIFIC_NONE. gdb/ChangeLog: * gdbtypes.c (internal_type_self_type): If TYPE_SPECIFIC_FIELD hasn't been initialized yet, return NULL. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7de64c509d0..36889aa6e6f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2015-02-11 Doug Evans + + * gdbtypes.c (internal_type_self_type): If TYPE_SPECIFIC_FIELD hasn't + been initialized yet, return NULL. + 2015-02-11 Doug Evans * symfile.h (new_symfile_objfile): Delete. diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 2abaffedf8e..a80151cbe44 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1209,9 +1209,13 @@ internal_type_self_type (struct type *type) { case TYPE_CODE_METHODPTR: case TYPE_CODE_MEMBERPTR: + if (TYPE_SPECIFIC_FIELD (type) == TYPE_SPECIFIC_NONE) + return NULL; gdb_assert (TYPE_SPECIFIC_FIELD (type) == TYPE_SPECIFIC_SELF_TYPE); return TYPE_MAIN_TYPE (type)->type_specific.self_type; case TYPE_CODE_METHOD: + if (TYPE_SPECIFIC_FIELD (type) == TYPE_SPECIFIC_NONE) + return NULL; gdb_assert (TYPE_SPECIFIC_FIELD (type) == TYPE_SPECIFIC_FUNC); return TYPE_MAIN_TYPE (type)->type_specific.func_stuff->self_type; default: