diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2015-08-11 23:11:36 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2015-08-11 23:11:36 +0000 |
commit | 7a8dfe707bb29938b5109614d49623847fba81f1 (patch) | |
tree | 7ecec73827de5c2657b2d50e39d8e48c9007b588 /gcc | |
parent | 5d44e40bb5ddc05b604a02e1b4f56ced179ac95b (diff) | |
download | gcc-7a8dfe707bb29938b5109614d49623847fba81f1.zip gcc-7a8dfe707bb29938b5109614d49623847fba81f1.tar.gz gcc-7a8dfe707bb29938b5109614d49623847fba81f1.tar.bz2 |
compiler: Check for EOF in malformed signatures.
When parsing a malformed function declaration with invalid parameters,
gccgo would infinitely loop looking for the end of the function
declaration.
Fixes golang/go#11530, golang/go#11531.
Reviewed-on: https://go-review.googlesource.com/13065
From-SVN: r226795
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/parse.cc | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 2cbe25c..5046fbb 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -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. diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc index 7f7eba4..211fd73 100644 --- a/gcc/go/gofrontend/parse.cc +++ b/gcc/go/gofrontend/parse.cc @@ -1045,7 +1045,8 @@ Parse::parameter_decl(bool parameters_have_names, { *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(); } } |