diff mbox

Fix PR77842

Message ID alpine.LSU.2.11.1610051133570.26629@t29.fhfr.qr
State New
Headers show

Commit Message

Richard Biener Oct. 5, 2016, 9:34 a.m. UTC
Committed as obvious.

Richard.

2016-10-05  Richard Biener  <rguenther@suse.de>

	PR middle-end/77842
	* genmatch.c (parser::parse_c_expr): Handle premature EOF.
diff mbox

Patch

Index: gcc/genmatch.c
===================================================================
--- gcc/genmatch.c	(revision 240770)
+++ gcc/genmatch.c	(working copy)
@@ -4124,6 +4152,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)