]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
internal_type_self_type: Handle TYPE_SPECIFIC_NONE.
authorDoug Evans <xdje42@gmail.com>
Wed, 11 Feb 2015 05:18:59 +0000 (21:18 -0800)
committerDoug Evans <xdje42@gmail.com>
Wed, 11 Feb 2015 05:18:59 +0000 (21:18 -0800)
gdb/ChangeLog:

* gdbtypes.c (internal_type_self_type): If TYPE_SPECIFIC_FIELD hasn't
been initialized yet, return NULL.

gdb/ChangeLog
gdb/gdbtypes.c

index 7de64c509d0b8ca5ad39b375368b46f7efdc0408..36889aa6e6f66d72ad600012c4d6911c1fb419b1 100644 (file)
@@ -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.
index 2abaffedf8ecb24760394682973a3c08d1951bf5..a80151cbe449c43d0b5593c1114f73164f421bc9 100644 (file)
@@ -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: