diff --git a/src/cmd/compile/internal/inline/inl.go b/src/cmd/compile/internal/inline/inl.go index c38ed8be7fb..e3462f54ec6 100644 --- a/src/cmd/compile/internal/inline/inl.go +++ b/src/cmd/compile/internal/inline/inl.go @@ -544,7 +544,7 @@ opSwitch: } } } - if name.Class == ir.PPARAM { + if name.Class == ir.PPARAM || name.Class == ir.PAUTOHEAP && name.IsClosureVar() { extraCost = min(extraCost, inlineParamCallCost) } }