mirror of https://github.com/golang/go.git
cmd/cc: fix undefined behaviour warning in bv.c
Fixes warning # _/home/dfc/go/misc/cgo/test/backdoor /home/dfc/go/src/cmd/cc/bv.c:43:11: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/136330043
This commit is contained in:
parent
6a2e844f51
commit
4a40fb1979
|
|
@ -40,6 +40,6 @@ bvset(Bvec *bv, int32 i)
|
|||
|
||||
if(i < 0 || i >= bv->n)
|
||||
fatal(Z, "bvset: index %d is out of bounds with length %d\n", i, bv->n);
|
||||
mask = 1 << (i % WORDBITS);
|
||||
mask = 1UL << (i % WORDBITS);
|
||||
bv->b[i / WORDBITS] |= mask;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue