summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorreichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-05 23:41:22 +0000
committerreichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-05 23:41:22 +0000
commitcd27e3acbd98d582d3adcc8a89973841e0c78361 (patch)
treefbc37391729f934dcc29d7e70e54e555edccd9ef /gcc/c-decl.c
parentab77410140d94af9295eaa9ba17fa56df37bd90d (diff)
downloadgcc-cd27e3acbd98d582d3adcc8a89973841e0c78361.tar.gz
PR c/28502
* c-decl.c (validate_proto_after_old_defn): Return false on invalid argument. * gcc.dg/proto-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115957 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index b900e8a8d5d..9a0e747c713 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;