aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/gc/escape.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/gc/escape.go')
-rw-r--r--src/cmd/compile/internal/gc/escape.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/gc/escape.go b/src/cmd/compile/internal/gc/escape.go
index 08000dd374..2c55163100 100644
--- a/src/cmd/compile/internal/gc/escape.go
+++ b/src/cmd/compile/internal/gc/escape.go
@@ -1379,9 +1379,10 @@ func containsClosure(f, c *Node) bool {
// leak records that parameter l leaks to sink.
func (l *EscLocation) leakTo(sink *EscLocation, derefs int) {
- // If sink is a result parameter and we can fit return bits
- // into the escape analysis tag, then record a return leak.
- if sink.isName(PPARAMOUT) && sink.curfn == l.curfn {
+ // If sink is a result parameter that doesn't escape (#44614)
+ // and we can fit return bits into the escape analysis tag,
+ // then record as a result leak.
+ if !sink.escapes && sink.isName(PPARAMOUT) && sink.curfn == l.curfn {
// TODO(mdempsky): Eliminate dependency on Vargen here.
ri := int(sink.n.Name.Vargen) - 1
if ri < numEscResults {