Commit 6a2e844f authored by Dave Cheney's avatar Dave Cheney

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