summaryrefslogtreecommitdiff
path: root/gcc/c-typeck.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-10-27 16:50:50 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2009-10-27 16:50:50 +0100
commit06302a02c05eeaeea9e8597dfc6ed3d0e0085357 (patch)
tree522ccf534520423c5fa756e2c5fe5d52a6ed93a5 /gcc/c-typeck.c
parentb57d8e6f0c9b54102f8c96798e652283ca603814 (diff)
downloadgcc-06302a02c05eeaeea9e8597dfc6ed3d0e0085357.tar.gz
re PR c/41842 (ICE on invalid variable length array declaration)
PR c/41842 * c-typeck.c (convert_arguments): Return -1 if any of the arguments is error_mark_node. * gcc.dg/pr41842.c: New test. From-SVN: r153599
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r--gcc/c-typeck.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index c7d2bc8da22..9b1f09c4593 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -2739,6 +2739,7 @@ convert_arguments (tree typelist, VEC(tree,gc) *values,
{
tree typetail, val;
unsigned int parmnum;
+ bool error_args = false;
const bool type_generic = fundecl
&& lookup_attribute ("type generic", TYPE_ATTRIBUTES(TREE_TYPE (fundecl)));
bool type_generic_remove_excess_precision = false;
@@ -3008,6 +3009,8 @@ convert_arguments (tree typelist, VEC(tree,gc) *values,
parmval = default_conversion (val);
VEC_replace (tree, values, parmnum, parmval);
+ if (parmval == error_mark_node)
+ error_args = true;
if (typetail)
typetail = TREE_CHAIN (typetail);
@@ -3021,7 +3024,7 @@ convert_arguments (tree typelist, VEC(tree,gc) *values,
return -1;
}
- return parmnum;
+ return error_args ? -1 : (int) parmnum;
}
/* This is the entry point used by the parser to build unary operators