Commit 8fe5ef40 authored by Shenghou Ma's avatar Shenghou Ma

cmd/ld: fix off-by-one error when emitting symbol names

I diffed the output of `nm -n gofmt' before and after this change,
and verified that all changes are correct and all corrupted symbol
names are fixed.

Fixes #8906.

LGTM=iant, cookieo9
R=golang-codereviews, iant, cookieo9
CC=golang-codereviews
https://golang.org/cl/159750043
parent c689abd5
......@@ -590,8 +590,7 @@ machosymtab(void)
if(strstr(s->extname, "·") == nil) {
addstring(symstr, s->extname);
} else {
p = s->extname;
while (*p++ != '\0') {
for(p = s->extname; *p; p++) {
if((uchar)*p == 0xc2 && (uchar)*(p+1) == 0xb7) {
adduint8(ctxt, symstr, '.');
p++;
......
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