projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
70f3cf6
)
Better handling of unexpected EOF in parser.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 21 Sep 2011 21:06:42 +0000
(21:06 +0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 21 Sep 2011 21:06:42 +0000
(21:06 +0000)
From-SVN: r179060
gcc/go/gofrontend/parse.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/parse.cc
b/gcc/go/gofrontend/parse.cc
index b91bfbdbf030939fcc1277165983810902ef6430..d914bebd36bdc75696f99045cc744e8dfe9ae0c7 100644
(file)
--- a/
gcc/go/gofrontend/parse.cc
+++ b/
gcc/go/gofrontend/parse.cc
@@
-1299,6
+1299,13
@@
Parse::declaration_may_start_here()
void
Parse::decl(void (Parse::*pfn)(void*), void* varg)
{
+ if (this->peek_token()->is_eof())
+ {
+ if (!saw_errors())
+ error_at(this->location(), "unexpected end of file");
+ return;
+ }
+
if (!this->peek_token()->is_op(OPERATOR_LPAREN))
(this->*pfn)(varg);
else