diff options
Diffstat (limited to 'src/cmd/compile/internal/escape/escape.go')
-rw-r--r-- | src/cmd/compile/internal/escape/escape.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/escape/escape.go b/src/cmd/compile/internal/escape/escape.go index 883e68a730..58cad73c76 100644 --- a/src/cmd/compile/internal/escape/escape.go +++ b/src/cmd/compile/internal/escape/escape.go @@ -781,6 +781,16 @@ func (e *escape) exprSkipInit(k hole, n ir.Node) { } } + for _, n := range fn.Dcl { + // Add locations for local variables of the + // closure, if needed, in case we're not including + // the closure func in the batch for escape + // analysis (happens for escape analysis called + // from reflectdata.methodWrapper) + if n.Op() == ir.ONAME && n.Opt == nil { + e.with(fn).newLoc(n, false) + } + } e.walkFunc(fn) } |