From 8777759f593be7af2a0266e0b871aa0af3200962 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 2 Dec 2009 23:23:11 -0800 Subject: [PATCH] gc: make 'invalid rune in string' a little less cryptic Fixes #371. R=ken2 https://golang.org/cl/164091 --- src/cmd/gc/lex.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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