Commit a152dd04 authored by Matthew Dempsky's avatar Matthew Dempsky

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: default avatarCherry Zhang <cherryyz@google.com>
parent f0fdbb1e
...@@ -46,11 +46,14 @@ import ( ...@@ -46,11 +46,14 @@ import (
var newescape bool var newescape bool
func escapes(all []*Node) { func escapes(all []*Node) {
esc := escAnalyze visitBottomUp(all, escapeImpl())
}
func escapeImpl() func([]*Node, bool) {
if newescape { if newescape {
esc = escapeFuncs return escapeFuncs
} }
visitBottomUp(all, esc) return escAnalyze
} }
const ( const (
......
...@@ -1574,7 +1574,7 @@ func genwrapper(rcvr *types.Type, method *types.Field, newnam *types.Sym) { ...@@ -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 { if rcvr.IsPtr() && rcvr.Elem() == method.Type.Recv().Type && rcvr.Elem().Sym != nil {
inlcalls(fn) inlcalls(fn)
} }
escAnalyze([]*Node{fn}, false) escapeImpl()([]*Node{fn}, false)
Curfn = nil Curfn = nil
funccompile(fn) funccompile(fn)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment