Commit be2fa211 by Eric Botcazou Committed by Eric Botcazou

re PR c/9799 (mismatching structure initializer with nested flexible array member, segfaults)

	PR c/9799
	* c-typeck.c (push_init_level): Add sanity check.

From-SVN: r63831
parent 8234c6c1
2003-03-05 Eric Botcazou <ebotcazou@libertysurf.fr>
PR c/9799
* c-typeck.c (push_init_level): Add sanity check.
Wed Mar 5 02:04:04 CET 2003 Jan Hubicka <jh@suse.cz>
* toplev.c (rest_of_compilation): Deffer RTL compilation only when
......
......@@ -5273,6 +5273,7 @@ push_init_level (implicit)
&& constructor_fields == 0)
process_init_element (pop_init_level (1));
else if (TREE_CODE (constructor_type) == ARRAY_TYPE
&& constructor_max_index
&& tree_int_cst_lt (constructor_max_index, constructor_index))
process_init_element (pop_init_level (1));
else
......
2003-03-05 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.c-torture/compile/20030305-1.c
Wed Mar 5 02:05:19 CET 2003 Jan Hubicka <jh@suse.cz>
* gcc.dg/i386-local.c: New.
......
/* PR c/9799 */
/* Verify that GCC doesn't crash on excess elements
in initializer for a flexible array member. */
typedef struct {
int aaa;
} s1_t;
typedef struct {
int bbb;
s1_t s1_array[];
} s2_t;
static s2_t s2_array[]= {
{ 1, 4 },
{ 2, 5 },
{ 3, 6 }
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment