diff options
author | Marek Polacek <polacek@redhat.com> | 2016-07-29 11:48:36 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2016-07-29 11:48:36 +0000 |
commit | a5b5c8b62494c0089bfc60ad5dfeae4e7f4c6690 (patch) | |
tree | 82438dd0eee48ce62911adc53aee6ffa7ce76d1d /gcc/c | |
parent | 0c4c49092a6bb3b9ec716c42194183b111e5d71e (diff) | |
download | gcc-a5b5c8b62494c0089bfc60ad5dfeae4e7f4c6690.zip gcc-a5b5c8b62494c0089bfc60ad5dfeae4e7f4c6690.tar.gz gcc-a5b5c8b62494c0089bfc60ad5dfeae4e7f4c6690.tar.bz2 |
re PR c/71583 (ICE on invalid code on x86_64-linux-gnu (in c_parser_postfix_expression_after_paren_type, at c/c-parser.c:8192))
PR c/71583
* c-parser.c (c_parser_postfix_expression_after_paren_type): Also
check expr.value.
* gcc.dg/noncompile/pr71583.c: New test.
From-SVN: r238861
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c/c-parser.c | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index b1c42ff..a47b8a3 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2016-07-29 Marek Polacek <polacek@redhat.com> + + PR c/71583 + * c-parser.c (c_parser_postfix_expression_after_paren_type): Also + check expr.value. + 2016-07-22 Uros Bizjak <ubizjak@gmail.com> * c-typeck.c: Use HOST_WIDE_INT_1 instead of (HOST_WIDE_INT) 1, diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 8952bca..a86cae2 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -8232,7 +8232,9 @@ c_parser_postfix_expression_after_paren_type (c_parser *parser, set_c_expr_source_range (&expr, init.src_range); expr.original_code = ERROR_MARK; expr.original_type = NULL; - if (type != error_mark_node && type_expr) + if (type != error_mark_node + && expr.value != error_mark_node + && type_expr) { if (TREE_CODE (expr.value) == C_MAYBE_CONST_EXPR) { |