diff options
author | Volker Reichelt <reichelt@igpm.rwth-aachen.de> | 2006-08-05 23:41:22 +0000 |
---|---|---|
committer | Volker Reichelt <reichelt@gcc.gnu.org> | 2006-08-05 23:41:22 +0000 |
commit | ffc44ab6831b7834cc88993c3fec7e9563747184 (patch) | |
tree | fbc37391729f934dcc29d7e70e54e555edccd9ef /gcc/c-decl.c | |
parent | c0bcacec2d602672e56efcd6575a629dd22a41d1 (diff) | |
download | gcc-ffc44ab6831b7834cc88993c3fec7e9563747184.zip gcc-ffc44ab6831b7834cc88993c3fec7e9563747184.tar.gz gcc-ffc44ab6831b7834cc88993c3fec7e9563747184.tar.bz2 |
re PR c/28502 (ICE with invalid declaration after definition)
PR c/28502
* c-decl.c (validate_proto_after_old_defn): Return false on invalid
argument.
* gcc.dg/proto-1.c: New test.
From-SVN: r115957
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index b900e8a..9a0e747 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1083,8 +1083,14 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype) for (;;) { - tree oldargtype = TYPE_MAIN_VARIANT (TREE_VALUE (oldargs)); - tree newargtype = TYPE_MAIN_VARIANT (TREE_VALUE (newargs)); + tree oldargtype = TREE_VALUE (oldargs); + tree newargtype = TREE_VALUE (newargs); + + if (oldargtype == error_mark_node || newargtype == error_mark_node) + return false; + + oldargtype = TYPE_MAIN_VARIANT (oldargtype); + newargtype = TYPE_MAIN_VARIANT (newargtype); if (END_OF_ARGLIST (oldargtype) && END_OF_ARGLIST (newargtype)) break; |