This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Go patch committed: Fix C-style comment parsing
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Tue, 08 Jul 2014 13:50:01 -0700
- Subject: Go patch committed: Fix C-style comment parsing
- Authentication-results: sourceware.org; auth=none
PR 61746 and gofrontend issue 35 point out a bug in C-style comment
parsing in the Go frontend. The sequence /*/ was interpreted as a
complete C-style comment. This patch fixes the bug. Bootstrapped and
ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline and
4.9 branch.
Ian
diff -r 5d0434c2007e go/lex.cc
--- a/go/lex.cc Wed Jul 02 07:22:05 2014 -0700
+++ b/go/lex.cc Tue Jul 08 13:41:25 2014 -0700
@@ -598,7 +598,7 @@
}
else if (p[1] == '*')
{
- this->lineoff_ = p - this->linebuf_;
+ this->lineoff_ = p + 2 - this->linebuf_;
Location location = this->location();
if (!this->skip_c_comment())
return Token::make_invalid_token(location);