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
This commit is contained in:
Richard Henderson 2002-02-10 18:28:00 -08:00 committed by Richard Henderson
parent 65739e62e4
commit fba78abb53
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,8 @@
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

View File

@ -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;
}