]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: use newnamel in ssa.go
authorJosh Bleecher Snyder <josharian@gmail.com>
Tue, 28 Mar 2017 22:51:05 +0000 (15:51 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Fri, 31 Mar 2017 20:05:26 +0000 (20:05 +0000)
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>

src/cmd/compile/internal/gc/ssa.go

index 3a49a775b60848b55b881adb3802f8103455208b..e5f1beb0ce541f63019ce8a627307842d06b4ebf 100644 (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.
                // We get back an SSA value representing &sync.(*Mutex).UnlockĀ·f.
                // 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.Pos = fn.Pos
                n2.Type = Types[TUINT8] // dummy type for a static closure. Could use runtime.funcval if we had it.