Commit 5b15b444 authored by Russ Cox's avatar Russ Cox

cmd/cc: fix lexbody for negative chars

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
parent 35e1deae
...@@ -665,7 +665,7 @@ loop: ...@@ -665,7 +665,7 @@ loop:
goto pop; goto pop;
} }
fi.p = i->b + 1; fi.p = i->b + 1;
return i->b[0]; return i->b[0] & 0xff;
pop: pop:
iostack = i->link; iostack = i->link;
...@@ -678,7 +678,7 @@ pop: ...@@ -678,7 +678,7 @@ pop:
fi.c = i->c; fi.c = i->c;
if(--fi.c < 0) if(--fi.c < 0)
goto loop; goto loop;
return *fi.p++; return *fi.p++ & 0xff;
} }
void void
......
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