aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1997-02-02 08:07:46 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1997-02-02 08:07:46 -0500
commitec0bc8b600ba51ec70343cd23905aae08cd0f39f (patch)
treea30d7faab166db8f9d487f2fa14cfda689ee5a84 /gcc
parentd71f83ca54e3c799a89313d7cb6d10a13314cfc9 (diff)
downloadgcc-ec0bc8b600ba51ec70343cd23905aae08cd0f39f.zip
gcc-ec0bc8b600ba51ec70343cd23905aae08cd0f39f.tar.gz
gcc-ec0bc8b600ba51ec70343cd23905aae08cd0f39f.tar.bz2
(process_init_element): When popping levels, don't blow up if
constructor_max_index not set due to previous error. From-SVN: r13582
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-typeck.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 7e5608c2..592cad1 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -1,5 +1,5 @@
/* Build expressions with type checking for C compiler.
- Copyright (C) 1987, 88, 91, 92-5, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 91, 92-6, 1997 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -6213,7 +6213,9 @@ process_init_element (value)
&& constructor_fields == 0)
process_init_element (pop_init_level (1));
else if (TREE_CODE (constructor_type) == ARRAY_TYPE
- && tree_int_cst_lt (constructor_max_index, constructor_index))
+ && (constructor_max_index == 0
+ || tree_int_cst_lt (constructor_max_index,
+ constructor_index)))
process_init_element (pop_init_level (1));
else
break;