From 04940ba5b4caacc81209367d000a3039c171d24f Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Fri, 5 Sep 1997 20:06:11 +0000 Subject: [PATCH] sdbout.c (plain_type_1, [...]): Verify that TYPE_DOMAIN has integer TYPE_{MAX,MIN}_VALUE before using them. * sdbout.c (plain_type_1, case ARRAY_TYPE): Verify that TYPE_DOMAIN has integer TYPE_{MAX,MIN}_VALUE before using them. Bring over from the FSF. From-SVN: r15117 --- gcc/ChangeLog | 3 +++ gcc/sdbout.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c28d70d3d7e..4ebd534e522 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -25,6 +25,9 @@ Fri Sep 5 10:08:44 1997 Jeffrey A Law (law@cygnus.com) Fri Sep 5 09:37:50 1997 Jim Wilson (wilson@cygnus.com) + * sdbout.c (plain_type_1, case ARRAY_TYPE): Verify that TYPE_DOMAIN + has integer TYPE_{MAX,MIN}_VALUE before using them. + * m68k/m68k.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Add __HPUX_ASM__ versions. diff --git a/gcc/sdbout.c b/gcc/sdbout.c index 046ec3205af..a306c81a365 100644 --- a/gcc/sdbout.c +++ b/gcc/sdbout.c @@ -584,6 +584,8 @@ plain_type_1 (type, level) if (sdb_n_dims < SDB_MAX_DIM) sdb_dims[sdb_n_dims++] = (TYPE_DOMAIN (type) + && TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) == INTEGER_CST + && TREE_CODE (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) == INTEGER_CST ? (TREE_INT_CST_LOW (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) - TREE_INT_CST_LOW (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) + 1) : 0);