]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/compile/internal/noder/reader.go
cmd/compile: scanning closures body when visiting wrapper function
[gostls13.git] / src / cmd / compile / internal / noder / reader.go
index 70f51e2253e119ad1c120e954d3ce83bb311cbd2..610d02c07c90fd6e57196ad6eb0cf884c30921e7 100644 (file)
@@ -3919,7 +3919,11 @@ func finishWrapperFunc(fn *ir.Func, target *ir.Package) {
        // The body of wrapper function after inlining may reveal new ir.OMETHVALUE node,
        // we don't know whether wrapper function has been generated for it or not, so
        // generate one immediately here.
-       ir.VisitList(fn.Body, func(n ir.Node) {
+       //
+       // Further, after CL 492017, function that construct closures is allowed to be inlined,
+       // even though the closure itself can't be inline. So we also need to visit body of any
+       // closure that we see when visiting body of the wrapper function.
+       ir.VisitFuncAndClosures(fn, func(n ir.Node) {
                if n, ok := n.(*ir.SelectorExpr); ok && n.Op() == ir.OMETHVALUE {
                        wrapMethodValue(n.X.Type(), n.Selection, target, true)
                }