Commit 63544c47 authored by Eoghan Sherry's avatar Eoghan Sherry Committed by Russ Cox

ld: fix dwarf decoding of 64-bit reflect values

R=rsc
CC=golang-dev
https://golang.org/cl/3002041
parent 7e14bd81
......@@ -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
......
......@@ -592,8 +592,13 @@ nuxiinit(void)
if(i < 1)
inuxi1[i] = c;
inuxi4[i] = c;
inuxi8[i] = c;
inuxi8[i+4] = c+4;
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment