]> Cypherpunks repositories - gostls13.git/commit
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)
committerGopher Robot <gobot@golang.org>
Wed, 18 Sep 2024 16:23:28 +0000 (16:23 +0000)
commitdb40d1a4c434e319e70af87ef1024a211a9e5a98
treee8578067375b4870152efa3387a3064342aa650f
parent889178d5b67b0e2687e1c04c5ea9c2774b0d466a
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.

Fixes #69434
Fixes #69507

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>
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]