mirror of
https://github.com/golang/go
synced 2024-11-19 21:54:40 -07: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:
parent
31bd41e04b
commit
6a2e844f51
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user