OSDN Git Service

(process_init_element): When popping levels, don't blow up if
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 2 Feb 1997 13:07:46 +0000 (13:07 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 2 Feb 1997 13:07:46 +0000 (13:07 +0000)
constructor_max_index not set due to previous error.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13582 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/c-typeck.c

index 7e5608c..592cad1 100644 (file)
@@ -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;