This provides better diagnostics when it occurs.
Updates #19751
Change-Id: I87db54c22e1345891b418c1741dc76ac5fb8ed00
Reviewed-on: https://go-review.googlesource.com/39358
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
func bvbulkalloc(nbit int32, count int32) bulkBvec {
nword := (nbit + WORDBITS - 1) / WORDBITS
+ size := int64(nword) * int64(count)
+ if int64(int32(size*4)) != size*4 {
+ Fatalf("bvbulkalloc too big: nbit=%d count=%d nword=%d size=%d", nbit, count, nword, size)
+ }
return bulkBvec{
- words: make([]uint32, nword*count),
+ words: make([]uint32, size),
nbit: nbit,
nword: nword,
}