1
0
mirror of https://github.com/golang/go synced 2024-11-18 06:24:47 -07:00

cmd/compile: use newnamel in ssa.go

For concurrency safety.

Passes toolstash-check.

Updates #15756.

Change-Id: I1caca231a962781ff8f4f589b2e0454d2820ffb6
Reviewed-on: https://go-review.googlesource.com/39192
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2017-03-28 15:51:05 -07:00
parent 3d90378df5
commit 8caf21da47

View File

@ -3003,7 +3003,8 @@ func (s *state) call(n *Node, k callKind) *ssa.Value {
// Make a PFUNC node out of that, then evaluate it. // Make a PFUNC node out of that, then evaluate it.
// We get back an SSA value representing &sync.(*Mutex).Unlock·f. // We get back an SSA value representing &sync.(*Mutex).Unlock·f.
// We can then pass that to defer or go. // We can then pass that to defer or go.
n2 := newname(fn.Sym) n2 := newnamel(fn.Pos, fn.Sym)
n2.Name.Curfn = s.curfn
n2.Class = PFUNC n2.Class = PFUNC
n2.Pos = fn.Pos n2.Pos = fn.Pos
n2.Type = Types[TUINT8] // dummy type for a static closure. Could use runtime.funcval if we had it. n2.Type = Types[TUINT8] // dummy type for a static closure. Could use runtime.funcval if we had it.