diff mbox

Fix tree checking failure with -fdump-ada-spec

Message ID 201103221122.39531.ebotcazou@adacore.com
State New
Headers show

Commit Message

Eric Botcazou March 22, 2011, 10:22 a.m. UTC
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.
diff mbox

Patch

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++;