This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] internal_type_self_type: Handle TYPE_SPECIFIC_NONE.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=eaaf76abdc6444e07860067e01c8135303a429ca

commit eaaf76abdc6444e07860067e01c8135303a429ca
Author: Doug Evans <xdje42@gmail.com>
Date:   Tue Feb 10 21:18:59 2015 -0800

    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:
---
 gdb/ChangeLog  | 5 +++++
 gdb/gdbtypes.c | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7de64c5..36889aa 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 2abaffe..a80151c 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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]