]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.23] cmd/compile: fix wrong esacpe analysis for rangefunc
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Wed, 18 Sep 2024 15:39:05 +0000 (22:39 +0700)
committerDavid Chase <drchase@google.com>
Wed, 25 Sep 2024 16:22:40 +0000 (16:22 +0000)
commitfbddfae62f19b5f04555aa593970ac4c6f5a38e5
tree9689e2f0196b350a9b964d44c571072ae710e0c0
parentc8c6f9abfbbd2f949285a527036a3d0dbd991e74
[release-branch.go1.23] cmd/compile: fix wrong esacpe analysis for rangefunc

CL 584596 "-range<N>" suffix to the name of closure generated for a
rangefunc loop body. However, this breaks the condition that escape
analysis uses for checking whether a closure contains within function,
which is "F.funcN" for outer function "F" and closure "funcN".

Fixing this by adding new "-rangeN" to the condition.

Updates #69434
Fixes #69511

Change-Id: I411de8f63b69a6514a9e9504d49d62e00ce4115d
Reviewed-on: https://go-review.googlesource.com/c/go/+/614096
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/614195
src/cmd/compile/internal/escape/solve.go
test/fixedbugs/issue69434.go [new file with mode: 0644]
test/fixedbugs/issue69507.go [new file with mode: 0644]