From: isharipo Date: Fri, 23 Mar 2018 18:56:21 +0000 (+0300) Subject: cmd/compile/internal/gc: properly initialize ssa.Func Type field X-Git-Tag: go1.11beta1~1127 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3afd2d7fc87615e124b77692e87095bdba79e557;p=gostls13.git cmd/compile/internal/gc: properly initialize ssa.Func Type field The ssa.Func has Type field that is described as function signature type. It never gets any value and remains nil. This leads to "" signature printed representation. Given this function declaration: func foo(x int, f func() string) (int, error) GOSSAFUNC printed it as below: compiling foo foo After this change: compiling foo foo func(int, func() string) (int, error) Change-Id: Iec5eec8aac5c76ff184659e30f41b2f5fe86d329 Reviewed-on: https://go-review.googlesource.com/102375 Run-TryBot: Iskander Sharipov TryBot-Result: Gobot Gobot Reviewed-by: Josh Bleecher Snyder --- diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index c6ecc263d8..91944357df 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -110,6 +110,7 @@ func buildssa(fn *Node, worker int) *ssa.Func { s.f = ssa.NewFunc(&fe) s.config = ssaConfig + s.f.Type = fn.Type s.f.Config = ssaConfig s.f.Cache = &ssaCaches[worker] s.f.Cache.Reset()