]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove two out-of-phase calls to walk
authorMatthew Dempsky <mdempsky@google.com>
Thu, 8 Mar 2018 10:22:26 +0000 (02:22 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 8 Mar 2018 18:22:13 +0000 (18:22 +0000)
All calls to walkstmt/walkexpr/etc should be rooted from funccompile,
whereas transformclosure and fninit are called by main.

Passes toolstash-check.

Change-Id: Ic880e2d2d83af09618ce4daa8e7716f6b389e53e
Reviewed-on: https://go-review.googlesource.com/99418
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/closure.go
src/cmd/compile/internal/gc/init.go

index 1a79b7b149fac9bfe9387cca7d18dce1641baf65..6f9025609034248826cda527c5c6d96139e34140 100644 (file)
@@ -417,7 +417,6 @@ func transformclosure(xfunc *Node) {
 
                if len(body) > 0 {
                        typecheckslice(body, Etop)
-                       walkstmtlist(body)
                        xfunc.Func.Enter.Set(body)
                        xfunc.Func.SetNeedctxt(true)
                }
index 180cbcfda2b09742f8b0ce7c5477c447cc08a6f8..ea42664ba2021e3dcfd9b0a5000e77e6c6df2b1c 100644 (file)
@@ -182,7 +182,6 @@ func fninit(n []*Node) {
                loop.Ninit.Set1(zero)
 
                loop = typecheck(loop, Etop)
-               loop = walkstmt(loop)
                r = append(r, loop)
        }