diff options
author | Brendan Kehoe <brendan@gcc.gnu.org> | 1997-07-22 15:25:25 -0400 |
---|---|---|
committer | Brendan Kehoe <brendan@gcc.gnu.org> | 1997-07-22 15:25:25 -0400 |
commit | 7671d67b18474ccaf6e8422bf48f6fa67694bbc4 (patch) | |
tree | fc7e25f6b39be8bd9ea0d49967e18cd010508a47 /gcc/tree.c | |
parent | efc9daa36e39dd8970be51bd835e0cf3d67568ae (diff) | |
download | gcc-7671d67b18474ccaf6e8422bf48f6fa67694bbc4.zip gcc-7671d67b18474ccaf6e8422bf48f6fa67694bbc4.tar.gz gcc-7671d67b18474ccaf6e8422bf48f6fa67694bbc4.tar.bz2 |
tree.c (array_type_nelts): Make sure the domain of TYPE is set before we try to use it.
* tree.c (array_type_nelts): Make sure the domain of TYPE is set
before we try to use it.
From-SVN: r14518
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -2147,9 +2147,16 @@ tree array_type_nelts (type) tree type; { - tree index_type = TYPE_DOMAIN (type); - tree min = TYPE_MIN_VALUE (index_type); - tree max = TYPE_MAX_VALUE (index_type); + tree index_type, min, max; + + /* If they did it with unspecified bounds, then we should have already + given an error about it before we got here. */ + if (! TYPE_DOMAIN (type)) + return error_mark_node; + + index_type = TYPE_DOMAIN (type); + min = TYPE_MIN_VALUE (index_type); + max = TYPE_MAX_VALUE (index_type); if (! TREE_CONSTANT (min)) { |