From: Russ Cox Date: Tue, 20 Oct 2009 02:55:17 +0000 (-0700) Subject: bug169 X-Git-Tag: weekly.2009-11-06~260 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1be74762c18bd699e369b33e8c2a94b6f23b4c3d;p=gostls13.git bug169 R=ken OCL=35899 CL=35899 --- diff --git a/src/cmd/gc/lex.c b/src/cmd/gc/lex.c index 8cfa105ac3..f356906e50 100644 --- a/src/cmd/gc/lex.c +++ b/src/cmd/gc/lex.c @@ -537,8 +537,10 @@ l0: case '\'': /* '.' */ - if(escchar('\'', &escflag, &v)) - v = '\''; // allow ''' + if(escchar('\'', &escflag, &v)) { + yyerror("empty character literal or unescaped ' in character literal"); + v = '\''; + } if(!escchar('\'', &escflag, &v)) { yyerror("missing '"); ungetc(v); diff --git a/test/bugs/bug169.go b/test/fixedbugs/bug169.go similarity index 100% rename from test/bugs/bug169.go rename to test/fixedbugs/bug169.go diff --git a/test/golden.out b/test/golden.out index 90f21172cf..6d70cb9e0d 100644 --- a/test/golden.out +++ b/test/golden.out @@ -147,9 +147,6 @@ BUG: errchk: command succeeded unexpectedly 123 BUG: should fail -=========== bugs/bug169.go -BUG: errchk: command succeeded unexpectedly - =========== bugs/bug193.go BUG: errchk: bugs/bug193.go:14: missing expected error: 'shift'