From: Richard Biener Date: Wed, 5 Oct 2016 09:36:27 +0000 (+0000) Subject: re PR middle-end/77842 (genmatch segfault on a missing brace) X-Git-Tag: upstream/12.2.0~44359 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a5382f1c6b729ce1cce0c76db8139f4dbe3caae7;p=platform%2Fupstream%2Fgcc.git re PR middle-end/77842 (genmatch segfault on a missing brace) 2016-10-05 Richard Biener PR middle-end/77842 * genmatch.c (parser::parse_c_expr): Handle premature EOF. From-SVN: r240774 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 34efb7c..b8976e3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-10-05 Richard Biener + + PR middle-end/77842 + * genmatch.c (parser::parse_c_expr): Handle premature EOF. + 2016-10-05 Pierre-Marie de Rodat * dwarf2out.c (dwarf2out_imported_module_or_decl): Move DWARF diff --git a/gcc/genmatch.c b/gcc/genmatch.c index aa291ec..c3f128c 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)