From: Russ Cox Date: Thu, 3 Dec 2009 07:23:11 +0000 (-0800) Subject: gc: make 'invalid rune in string' a little less cryptic X-Git-Tag: weekly.2009-12-07~54 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8777759f593be7af2a0266e0b871aa0af3200962;p=gostls13.git gc: make 'invalid rune in string' a little less cryptic Fixes #371. R=ken2 https://golang.org/cl/164091 --- diff --git a/src/cmd/gc/lex.c b/src/cmd/gc/lex.c index f858aa95ec..c202f3ecdc 100644 --- a/src/cmd/gc/lex.c +++ b/src/cmd/gc/lex.c @@ -1065,7 +1065,9 @@ loop: goto loop; c = chartorune(&rune, str); if(rune == Runeerror && c == 1) { - yyerror("illegal rune in string"); + lineno = lexlineno; + yyerror("illegal UTF-8 sequence in comment or string"); + flusherrors(); for(c=0; c