* Go patch committed: Check for EOF when parsing function signature
@ 2015-08-11 23:11 Ian Lance Taylor
0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2015-08-11 23:11 UTC (permalink / raw)
To: gcc-patches, gofrontend-dev
[-- Attachment #1: Type: text/plain, Size: 327 bytes --]
This patch by Chris Manghane fixes the Go frontend to check for EOF
when parsing a function signature. This avoids an infinite loop on an
invalid program, and fixes https://golang.org/issue/11530 and
https://golang.org/issue/11531 . Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu. Committed to mainline.
Ian
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 963 bytes --]
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE (revision 226794)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-3b590ff53700963c1b8207a78594138e6a4e47f4
+55175f7ee0db2c1e68423216d7744be80071ed6c
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
Index: gcc/go/gofrontend/parse.cc
===================================================================
--- gcc/go/gofrontend/parse.cc (revision 226529)
+++ gcc/go/gofrontend/parse.cc (working copy)
@@ -1045,7 +1045,8 @@ Parse::parameter_decl(bool parameters_ha
{
*mix_error = true;
while (!this->peek_token()->is_op(OPERATOR_COMMA)
- && !this->peek_token()->is_op(OPERATOR_RPAREN))
+ && !this->peek_token()->is_op(OPERATOR_RPAREN)
+ && !this->peek_token()->is_eof())
this->advance_token();
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-08-11 23:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-11 23:11 Go patch committed: Check for EOF when parsing function signature Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).