aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-02-10 18:28:00 -0800
committerRichard Henderson <rth@gcc.gnu.org>2002-02-10 18:28:00 -0800
commitfba78abb53543eacccb19dd42429dcd889fe21a9 (patch)
tree92686c90ff478918b9e03bda1766159ef23938a5 /gcc
parent65739e62e4c32be813d518e943249b2c9a3512e3 (diff)
downloadgcc-fba78abb53543eacccb19dd42429dcd889fe21a9.zip
gcc-fba78abb53543eacccb19dd42429dcd889fe21a9.tar.gz
gcc-fba78abb53543eacccb19dd42429dcd889fe21a9.tar.bz2
re PR c/5623 (GCC 3.0.3 crashes when assigning pointer to an array of undefined size which is member of a struct)
PR c/5623 * c-typeck.c (incomplete_type_error): Handle flexible array members. From-SVN: r49663
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/c-typeck.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 35a8728..790bc10 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2002-02-10 Richard Henderson <rth@redhat.com>
+ PR c/5623
+ * c-typeck.c (incomplete_type_error): Handle flexible array members.
+
+2002-02-10 Richard Henderson <rth@redhat.com>
+
PR c++/5624
* tree.c (append_random_chars): Don't abort if main_input_filename
does not exist.
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index dc844bf..5d5b5f9 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -149,6 +149,11 @@ incomplete_type_error (value, type)
case ARRAY_TYPE:
if (TYPE_DOMAIN (type))
{
+ if (TYPE_MAX_VALUE (TYPE_DOMAIN (type)) == NULL)
+ {
+ error ("invalid use of flexible array member");
+ return;
+ }
type = TREE_TYPE (type);
goto retry;
}