summaryrefslogtreecommitdiff
path: root/gcc/genmatch.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-10-05 09:36:27 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-10-05 09:36:27 +0000
commita5382f1c6b729ce1cce0c76db8139f4dbe3caae7 (patch)
tree95503b1dfa1f8d440866bd81bdfad8303580bbb7 /gcc/genmatch.c
parentf9018d752dd0a80491566988112d2172adfcdde7 (diff)
re PR middle-end/77842 (genmatch segfault on a missing brace)
2016-10-05 Richard Biener <rguenther@suse.de> PR middle-end/77842 * genmatch.c (parser::parse_c_expr): Handle premature EOF. From-SVN: r240774
Diffstat (limited to 'gcc/genmatch.c')
-rw-r--r--gcc/genmatch.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/genmatch.c b/gcc/genmatch.c
index aa291ec3013..c3f128cd26e 100644
--- a/gcc/genmatch.c
+++ b/gcc/genmatch.c
@@ -4124,6 +4124,8 @@ parser::parse_c_expr (cpp_ttype start)
else if (token->type == end
&& --opencnt == 0)
break;
+ else if (token->type == CPP_EOF)
+ fatal_at (token, "unexpected end of file");
/* This is a lame way of counting the number of statements. */
if (token->type == CPP_SEMICOLON)