aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@libertysurf.fr>2003-03-05 09:37:57 +0100
committerEric Botcazou <ebotcazou@gcc.gnu.org>2003-03-05 08:37:57 +0000
commitbe2fa2118342b5a2b489de82cc73da4dd75b7771 (patch)
tree0b6881bad170240cc4a52a58d5d512ca08d66c77 /gcc/testsuite
parent8234c6c11a17ea58b80719e228bf6904351f34f6 (diff)
downloadgcc-be2fa2118342b5a2b489de82cc73da4dd75b7771.zip
gcc-be2fa2118342b5a2b489de82cc73da4dd75b7771.tar.gz
gcc-be2fa2118342b5a2b489de82cc73da4dd75b7771.tar.bz2
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
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20030305-1.c18
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b67b566..0060172 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+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.
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030305-1.c b/gcc/testsuite/gcc.c-torture/compile/20030305-1.c
new file mode 100644
index 0000000..2f60819
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20030305-1.c
@@ -0,0 +1,18 @@
+/* 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 }
+};