1
0
mirror of https://github.com/golang/go synced 2024-11-18 22:55:23 -07:00

cmd/gc: fix undefined behaviour warnings in mparith3.c

Update #8527

Fixes two warnings:

src/cmd/gc/mparith3.c:255:10: runtime error: shift exponent 52 is too large for 32-bit type 'int'
src/cmd/gc/mparith3.c:254:14: runtime error: shift exponent 52 is too large for 32-bit type 'int'

LGTM=rsc
R=r, dvyukov, rsc
CC=golang-codereviews
https://golang.org/cl/134940044
This commit is contained in:
Dave Cheney 2014-08-27 15:23:38 +10:00
parent 1660ece769
commit 9c504696f4

View File

@ -251,8 +251,8 @@ mpgetfltN(Mpflt *a, int prec, int bias)
s = minexp - e;
if(s > prec+1)
s = prec+1;
if((v & ((1<<s)-1)) != 0)
v |= 1<<s;
if((v & ((1ULL<<s)-1)) != 0)
v |= 1ULL<<s;
v >>= s;
e = minexp;
}