sdbout.c (plain_type_1, [...]): Verify that TYPE_DOMAIN has integer TYPE_{MAX,MIN...
authorJim Wilson <wilson@cygnus.com>
Fri, 5 Sep 1997 20:06:11 +0000 (20:06 +0000)
committerJeff Law <law@gcc.gnu.org>
Fri, 5 Sep 1997 20:06:11 +0000 (14:06 -0600)
        * 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
gcc/sdbout.c

index c28d70d3d7ee8c4a874ebac3ba8a68882ee27436..4ebd534e5229f782906e6822b10cdb96cec93672 100644 (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.
 
index 046ec3205aff48c43e1fe7c1ad3727ca00f99bf0..a306c81a365ec6ff6a1646e3eaedb625e35c4396 100644 (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);