Change information
Commit message:
cmd/compile: disable inlining for functions using runtime.deferrangefunc
The rangefunc rewrite pass implements defer using deferrangefunc and
deferproccat. The loop body is rewritten into a closure, it cannot be
inlined due to defer call. But the outer function may still be inlined
in certain scenarios (e.g., with PGO), leading to the defer executing
at the wrong time.
Fixes #77033
Change-Id: I4649fad5cd1b65891832523522002d9352711123
Files:
- M src/cmd/compile/internal/inline/inl.go
- A src/cmd/compile/testdata/script/issue77033.txt
Change size: S
Delta: 2 files changed, 43 insertions(+), 0 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Code-Review: +2 by Cherry Mui, +2 by David Chase
TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI