1
0
mirror of https://github.com/golang/go synced 2024-11-20 11:04:56 -07:00

ld: fix dwarf decoding of 64-bit reflect values

R=rsc
CC=golang-dev
https://golang.org/cl/3002041
This commit is contained in:
Eoghan Sherry 2010-12-07 17:20:52 -05:00 committed by Russ Cox
parent 7e14bd81f4
commit 63544c4754
2 changed files with 19 additions and 8 deletions

View File

@ -800,20 +800,25 @@ decode_reloc(Sym *s, int32 off)
static uvlong static uvlong
decode_inuxi(uchar* p, int sz) decode_inuxi(uchar* p, int sz)
{ {
uvlong r; uint64 v;
uchar *inuxi; uint32 l;
uchar *cast, *inuxi;
int i; int i;
r = 0; v = l = 0;
cast = nil;
inuxi = nil; inuxi = nil;
switch (sz) { switch (sz) {
case 2: case 2:
cast = (uchar*)&l;
inuxi = inuxi2; inuxi = inuxi2;
break; break;
case 4: case 4:
cast = (uchar*)&l;
inuxi = inuxi4; inuxi = inuxi4;
break; break;
case 8: case 8:
cast = (uchar*)&v;
inuxi = inuxi8; inuxi = inuxi8;
break; break;
default: default:
@ -821,9 +826,10 @@ decode_inuxi(uchar* p, int sz)
errorexit(); errorexit();
} }
for (i = 0; i < sz; i++) for (i = 0; i < sz; i++)
r += p[i] << (8*inuxi[i]); cast[inuxi[i]] = p[i];
if (sz == 8)
return r; return v;
return l;
} }
// Type.commonType.kind // Type.commonType.kind

View File

@ -592,8 +592,13 @@ nuxiinit(void)
if(i < 1) if(i < 1)
inuxi1[i] = c; inuxi1[i] = c;
inuxi4[i] = c; inuxi4[i] = c;
inuxi8[i] = c; if(c == i) {
inuxi8[i+4] = c+4; inuxi8[i] = c;
inuxi8[i+4] = c+4;
} else {
inuxi8[i] = c+4;
inuxi8[i+4] = c;
}
fnuxi4[i] = c; fnuxi4[i] = c;
fnuxi8[i] = c; fnuxi8[i] = c;
fnuxi8[i+4] = c+4; fnuxi8[i+4] = c+4;