]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/bitvec: remove 2GB allocation limit in NewBulk
authorMichael Podtserkovskii <michaelpo@meta.com>
Tue, 13 Jan 2026 22:27:32 +0000 (22:27 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 12 Feb 2026 17:29:06 +0000 (09:29 -0800)
commitf745645e58d8c2da47da402871d92eab4c498187
treef6faf6273151c6dbc8e61212fb63f7b972f1204a
parentb45c59c443a0aac0abed3f35e8e307ec5e1c587b
cmd/compile/internal/bitvec: remove 2GB allocation limit in NewBulk

Remove the "NewBulk too big" check that prevented bulk bit vector
allocations exceeding ~2GB. This limit was overly restrictive and
caused compilation failures for large generated code.

The actual constraint is in the runtime's stackmap reader, which uses
int32 arithmetic. Add overflow checks in cmd/compile/internal/liveness
before stackmap serialization to detect this condition, allowing
NewBulk itself to allocate bulk large bit vector.

Fixes #77170

Change-Id: Ib7f2cabb28683258fc4e85418ba7fa70b48620b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/736240
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
src/cmd/compile/internal/bitvec/bv.go
src/cmd/compile/internal/liveness/arg.go
src/cmd/compile/internal/liveness/plive.go