]> Cypherpunks repositories - gostls13.git/commit
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)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 4 Mar 2025 11:10:17 +0000 (03:10 -0800)
commit4f45b2b7e079fc03d3444642e8a33ce6f959c6a6
treef01b3df3028947e5174f661022eccab35b0711a0
parent82791889ccfbcf7656b31211619a213b7f3109c5
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 #72063

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>
src/cmd/compile/internal/inline/inl.go
test/fixedbugs/issue72063.go [new file with mode: 0644]