Commit 132e5435 authored by Russ Cox's avatar Russ Cox

gc: line comments may end in EOF

R=ken2
CC=golang-dev
https://golang.org/cl/2907041
parent 68b4255a
...@@ -728,14 +728,10 @@ l0: ...@@ -728,14 +728,10 @@ l0:
if(c1 == '/') { if(c1 == '/') {
c = getlinepragma(); c = getlinepragma();
for(;;) { for(;;) {
if(c == '\n') { if(c == '\n' || c == EOF) {
ungetc(c); ungetc(c);
goto l0; goto l0;
} }
if(c == EOF) {
yyerror("eof in comment");
errorexit();
}
c = getr(); c = getr();
} }
} }
......
// $G $D/$F.go
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
// No newline at the end of this comment.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment