This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Fix tree checking failure with -fdump-ada-spec


We forget to check that something is a TYPE before using TYPE_METHODS.

Tested on i586-suse-linux, applied on the mainline as obvious.


2011-03-22  Eric Botcazou  <ebotcazou@adacore.com>

	* c-ada-spec.c (dump_ada_template): Skip non-class instances.


-- 
Eric Botcazou
Index: c-ada-spec.c
===================================================================
--- c-ada-spec.c	(revision 171210)
+++ c-ada-spec.c	(working copy)
@@ -1681,8 +1681,8 @@ dump_template_types (pretty_printer *buf
     }
 }
 
-/* Dump in BUFFER the contents of all instantiations associated with a given
-   template T.  CPP_CHECK is used to perform C++ queries on nodes.
+/* Dump in BUFFER the contents of all class instantiations associated with
+   a given template T.  CPP_CHECK is used to perform C++ queries on nodes.
    SPC is the indentation level. */
 
 static int
@@ -1701,7 +1701,7 @@ dump_ada_template (pretty_printer *buffe
       if (TREE_VEC_LENGTH (types) == 0)
 	break;
 
-      if (!TYPE_METHODS (instance))
+      if (!TYPE_P (instance) || !TYPE_METHODS (instance))
 	break;
 
       num_inst++;

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