Commit 4a40fb19 authored by Dave Cheney's avatar Dave Cheney

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
parent 6a2e844f
......@@ -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;
}
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