1
0
mirror of https://github.com/golang/go synced 2024-10-02 20:41:21 -06:00

cmd/gc: fix undefined behaviour warning in subr.c

Fixes warning

/home/dfc/go/src/cmd/gc/subr.c:3469:8: runtime error: negation of -9223372036854775808 cannot be represented in type 'int64' (aka 'long'); cast to an unsigned type to negate this value to itself

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/141220043
This commit is contained in:
Dave Cheney 2014-09-08 15:36:21 +10:00
parent 31bd41e04b
commit 6a2e844f51

View File

@ -3466,7 +3466,7 @@ smagic(Magic *m)
p = m->w-1; p = m->w-1;
ad = m->sd; ad = m->sd;
if(m->sd < 0) if(m->sd < 0)
ad = -m->sd; ad = -(uvlong)m->sd;
// bad denominators // bad denominators
if(ad == 0 || ad == 1 || ad == two31) { if(ad == 0 || ad == 1 || ad == two31) {