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
This commit is contained in:
Jim Wilson 1997-09-05 20:06:11 +00:00 committed by Jeff Law
parent f5ffa99918
commit 04940ba5b4
2 changed files with 5 additions and 0 deletions

View File

@ -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.

View File

@ -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);