1
0
mirror of https://github.com/golang/go synced 2024-11-19 07:14:45 -07:00

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
This commit is contained in:
Shenghou Ma 2014-10-10 20:30:24 -04:00
parent c689abd56c
commit 8fe5ef4052

View File

@ -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++;