mirror of
https://github.com/golang/go
synced 2024-11-18 00:04:43 -07:00
cmd/compile: Fatal instead of panic in large bvbulkalloc
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>
This commit is contained in:
parent
094498c9a1
commit
42426ed411
@ -29,8 +29,12 @@ type bulkBvec struct {
|
||||
|
||||
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,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user