Skip to content

Commit

Permalink
cmd/ld: fix off-by-one error when emitting symbol names
Browse files Browse the repository at this point in the history
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
  • Loading branch information
minux committed Oct 11, 2014
1 parent c689abd commit 8fe5ef4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/cmd/ld/macho.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit 8fe5ef4

Please sign in to comment.