From: Mikhail Maltsev Date: Sun, 18 Oct 2015 23:33:21 +0000 (+0000) Subject: Fix crash in gengtype debug dump X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5330e5a1586ce457d0cafd71485c3698e7f8c604;p=gcc.git Fix crash in gengtype debug dump gcc/ PR other/65800 * gengtype.c (dump_type): Handle TYPE_UNDEFINED correctly. From-SVN: r228956 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 46cff7ba6c9..d89db937b99 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 866d809889d..8c5c36d384e 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) {