aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Maltsev <maltsevm@gmail.com>2015-10-18 23:33:21 +0000
committerMikhail Maltsev <miyuki@gcc.gnu.org>2015-10-18 23:33:21 +0000
commit5330e5a1586ce457d0cafd71485c3698e7f8c604 (patch)
tree1d767b82aaefb98471a5fe99fcffb16ad36bab0e
parentd42becb9d876f54d0ee0b6c7a5ebfd30851b4e1d (diff)
downloadgcc-5330e5a1586ce457d0cafd71485c3698e7f8c604.zip
gcc-5330e5a1586ce457d0cafd71485c3698e7f8c604.tar.gz
gcc-5330e5a1586ce457d0cafd71485c3698e7f8c604.tar.bz2
Fix crash in gengtype debug dump
gcc/ PR other/65800 * gengtype.c (dump_type): Handle TYPE_UNDEFINED correctly. From-SVN: r228956
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/gengtype.c9
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 46cff7b..d89db93 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-18 Mikhail Maltsev <maltsevm@gmail.com>
+
+ PR other/65800
+ * gengtype.c (dump_type): Handle TYPE_UNDEFINED correctly.
+
2015-10-18 Iain Sandoe <iain@codesourcery.com>
* config/darwin.h (TARGET_SYSTEM_ROOT): Remove this from here,
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index 866d809..8c5c36d 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)
{