]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: allow pointer-containing elements in stack allocations
authorKeith Randall <khr@golang.org>
Sat, 15 Mar 2025 00:52:33 +0000 (17:52 -0700)
committerKeith Randall <khr@golang.org>
Fri, 4 Apr 2025 22:04:34 +0000 (15:04 -0700)
commit2d050e91a3cd411d018921b43f3161068b9dcbc6
treeee436db2cecbd6a3eb137d958426260e4579bcf7
parent7e60bdd7aada492c2f4a492d92439040974af2c5
cmd/compile: allow pointer-containing elements in stack allocations

For variable-sized allocations.

Turns out that we already implement the correct escape semantics
for this case. Even when the result of the "make" does not escape,
everything assigned into it does.

Change-Id: Ia123c538d39f2f1e1581c24e4135a65af3821c5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/657937
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
src/cmd/compile/internal/escape/utils.go
src/cmd/compile/internal/test/stack_test.go
src/cmd/compile/internal/walk/builtin.go
test/escape6.go [new file with mode: 0644]