This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix tree checking failure with -fdump-ada-spec
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 22 Mar 2011 11:22:39 +0100
- Subject: 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++;