* Go patch committed: Fix C-style comment parsing
@ 2014-07-08 20:50 Ian Lance Taylor
0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2014-07-08 20:50 UTC (permalink / raw)
To: gcc-patches, gofrontend-dev
[-- Attachment #1: Type: text/plain, Size: 297 bytes --]
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 401 bytes --]
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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-07-08 20:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-08 20:50 Go patch committed: Fix C-style comment parsing 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).