From 7671d67b18474ccaf6e8422bf48f6fa67694bbc4 Mon Sep 17 00:00:00 2001 From: Brendan Kehoe Date: Tue, 22 Jul 1997 15:25:25 -0400 Subject: [PATCH] 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 --- gcc/tree.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc/tree.c b/gcc/tree.c index 58a4173d420..0f91d7b1164 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -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)) { -- 2.30.2