1
0
mirror of https://github.com/golang/go synced 2024-11-19 03:04:42 -07:00

cmd/ld: fix undefined behaviour in pcln.c

Update #8527

Fixes, src/cmd/6l/../ld/pcln.c:93:18: runtime error: left shift of negative value -2

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/127440043
This commit is contained in:
Dave Cheney 2014-08-22 09:10:33 +10:00
parent ca2db2067f
commit f129370b3e

View File

@ -90,7 +90,7 @@ renumberfiles(Link *ctxt, LSym **files, int nfiles, Pcdata *d)
}
dv = val - newval;
newval = val;
v = (uint32)(dv<<1) ^ (uint32)(int32)(dv>>31);
v = ((uint32)dv<<1) ^ (uint32)(int32)(dv>>31);
addvarint(&out, v);
// pc delta