]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.24] cmd/compile: fix out of memory when inlining closure
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Mon, 3 Mar 2025 13:45:13 +0000 (20:45 +0700)
committerGopher Robot <gobot@golang.org>
Wed, 5 Mar 2025 21:27:11 +0000 (13:27 -0800)
commit0ace2d8aca5e99793e516ece3dfd8838f38dbcaf
tree6f7d5a13f9c71a4fb34d210d74788e43e47a96a7
parente4119e9b74e156ad473262f9f03c27a1491a138c
[release-branch.go1.24] cmd/compile: fix out of memory when inlining closure

CL 629195 strongly favor closure inlining, allowing closures to be
inlined more aggressively.

However, if the closure body contains a call to a function, which itself
is one of the call arguments, it causes the infinite inlining.

Fixing this by prevent this kind of functions from being inlinable.

Fixes #72067

Change-Id: I5fb5723a819b1e2c5aadb57c1023ec84ca9fa53c
Reviewed-on: https://go-review.googlesource.com/c/go/+/654195
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/654517
Commit-Queue: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
src/cmd/compile/internal/inline/inl.go
test/fixedbugs/issue72063.go [new file with mode: 0644]