From 5330e5a1586ce457d0cafd71485c3698e7f8c604 Mon Sep 17 00:00:00 2001 From: Mikhail Maltsev Date: Sun, 18 Oct 2015 23:33:21 +0000 Subject: [PATCH] Fix crash in gengtype debug dump gcc/ PR other/65800 * gengtype.c (dump_type): Handle TYPE_UNDEFINED correctly. From-SVN: r228956 --- gcc/ChangeLog | 5 +++++ gcc/gengtype.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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) { -- 2.30.2