From: miyuki Date: Sun, 18 Oct 2015 23:33:21 +0000 (+0000) Subject: Fix crash in gengtype debug dump X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c4a359c9a56ca1009289245af29bb00f5d1d73cb;p=thirdparty%2Fgcc.git Fix crash in gengtype debug dump gcc/ PR other/65800 * gengtype.c (dump_type): Handle TYPE_UNDEFINED correctly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228956 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 46cff7ba6c90..d89db937b99a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-10-18 Mikhail Maltsev + + PR other/65800 + * gengtype.c (dump_type): Handle TYPE_UNDEFINED correctly. + 2015-10-18 Iain Sandoe * config/darwin.h (TARGET_SYSTEM_ROOT): Remove this from here, diff --git a/gcc/gengtype.c b/gcc/gengtype.c index 866d809889d6..8c5c36d384e4 100644 --- a/gcc/gengtype.c +++ b/gcc/gengtype.c @@ -4878,10 +4878,17 @@ dump_type (int indent, type_p t) { PTR *slot; + printf ("%*cType at %p: ", indent, ' ', (void *) t); + if (t->kind == TYPE_UNDEFINED) + { + gcc_assert (t->gc_used == GC_UNUSED); + printf ("undefined.\n"); + return; + } + if (seen_types == NULL) seen_types = htab_create (100, htab_hash_pointer, htab_eq_pointer, NULL); - printf ("%*cType at %p: ", indent, ' ', (void *) t); slot = htab_find_slot (seen_types, t, INSERT); if (*slot != NULL) {