From 5b15b4443491d2405c494857819341186bb760ba Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 10 Jun 2013 16:13:25 -0400 Subject: [PATCH] cmd/cc: fix lexbody for negative chars MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The new code matches the code in cc/lex.c and the #define GETC. This was causing problems scanning runtime·foo if the leading · byte was returned by the buffer fill. R=ken2 CC=golang-dev https://golang.org/cl/10167043 --- src/cmd/cc/lexbody | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/cc/lexbody b/src/cmd/cc/lexbody index c5d51b8fb6..ccc0c405d0 100644 --- a/src/cmd/cc/lexbody +++ b/src/cmd/cc/lexbody @@ -665,7 +665,7 @@ loop: goto pop; } fi.p = i->b + 1; - return i->b[0]; + return i->b[0] & 0xff; pop: iostack = i->link; @@ -678,7 +678,7 @@ pop: fi.c = i->c; if(--fi.c < 0) goto loop; - return *fi.p++; + return *fi.p++ & 0xff; } void -- 2.48.1