1
0
mirror of https://github.com/golang/go synced 2024-11-25 03:07: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
decode_inuxi(uchar* p, int sz)
{
uvlong r;
uchar *inuxi;
uint64 v;
uint32 l;
uchar *cast, *inuxi;
int i;
r = 0;
v = l = 0;
cast = nil;
inuxi = nil;
switch (sz) {
case 2:
cast = (uchar*)&l;
inuxi = inuxi2;
break;
case 4:
cast = (uchar*)&l;
inuxi = inuxi4;
break;
case 8:
cast = (uchar*)&v;
inuxi = inuxi8;
break;
default:
@ -821,9 +826,10 @@ decode_inuxi(uchar* p, int sz)
errorexit();
}
for (i = 0; i < sz; i++)
r += p[i] << (8*inuxi[i]);
return r;
cast[inuxi[i]] = p[i];
if (sz == 8)
return v;
return l;
}
// Type.commonType.kind

View File

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