summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Evans <xdje42@gmail.com>2015-02-10 21:18:59 -0800
committerDoug Evans <xdje42@gmail.com>2015-02-10 21:18:59 -0800
commiteaaf76abdc6444e07860067e01c8135303a429ca (patch)
tree6744ab2a437c0dad7991a8b4858718311f49f228
parentd319a098bca9372e7d1840cd31c47d05b0c7540e (diff)
downloadbinutils-gdb-eaaf76abdc6444e07860067e01c8135303a429ca.tar.gz
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.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/gdbtypes.c4
2 files changed, 9 insertions, 0 deletions
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 <xdje42@gmail.com>
+
+ * gdbtypes.c (internal_type_self_type): If TYPE_SPECIFIC_FIELD hasn't
+ been initialized yet, return NULL.
+
2015-02-11 Doug Evans <dje@google.com>
* 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: