1
0
mirror of https://github.com/golang/go synced 2024-09-29 20:34:36 -06:00

cmd/compile: respect -newescape in genwrapper

Noticed while preparing a CL for Go 1.14 to remove esc.go.

Change-Id: Ic12be33f5b16c8424d85f373fa450247be086078
Reviewed-on: https://go-review.googlesource.com/c/go/+/173298
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
Matthew Dempsky 2019-04-22 16:08:43 -07:00
parent f0fdbb1e8b
commit a152dd0438
2 changed files with 7 additions and 4 deletions

View File

@ -46,11 +46,14 @@ import (
var newescape bool
func escapes(all []*Node) {
esc := escAnalyze
visitBottomUp(all, escapeImpl())
}
func escapeImpl() func([]*Node, bool) {
if newescape {
esc = escapeFuncs
return escapeFuncs
}
visitBottomUp(all, esc)
return escAnalyze
}
const (

View File

@ -1574,7 +1574,7 @@ func genwrapper(rcvr *types.Type, method *types.Field, newnam *types.Sym) {
if rcvr.IsPtr() && rcvr.Elem() == method.Type.Recv().Type && rcvr.Elem().Sym != nil {
inlcalls(fn)
}
escAnalyze([]*Node{fn}, false)
escapeImpl()([]*Node{fn}, false)
Curfn = nil
funccompile(fn)