mirror of
https://github.com/golang/go
synced 2024-11-21 15:34:45 -07:00
cmd/ld: don't allocate unused garbage space in pclntab file table
Fixes #6319. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/13539043
This commit is contained in:
parent
97d6a1e130
commit
d011f0aa89
@ -376,6 +376,12 @@ symgrow(Sym *s, int32 siz)
|
||||
if(s->np >= siz)
|
||||
return;
|
||||
|
||||
if(s->np > s->maxp) {
|
||||
cursym = s;
|
||||
diag("corrupt symbol data: np=%lld > maxp=%lld", (vlong)s->np, (vlong)s->maxp);
|
||||
errorexit();
|
||||
}
|
||||
|
||||
if(s->maxp < siz) {
|
||||
if(s->maxp == 0)
|
||||
s->maxp = 8;
|
||||
|
@ -2348,7 +2348,6 @@ ftabaddstring(Sym *ftab, char *s)
|
||||
start = ftab->np;
|
||||
symgrow(ftab, start+n+1);
|
||||
strcpy((char*)ftab->p + start, s);
|
||||
ftab->np += n+1;
|
||||
return start;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user