1
0
mirror of https://github.com/golang/go synced 2024-11-24 01:20:08 -07:00

cmd/compile: enforce no uses of Curfn in backend

Updates #15756

Change-Id: Id8d65ca9a3f1a7f9ea43e26cdd5e7d3befef8ba0
Reviewed-on: https://go-review.googlesource.com/38593
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2017-03-23 16:39:11 -07:00
parent 34975095d0
commit ef1ab0f0f4
2 changed files with 6 additions and 1 deletions

View File

@ -225,5 +225,7 @@ func tempAt(pos src.XPos, curfn *Node, t *Type) *Node {
// TODO(mdempsky/josharian): Remove all reads and writes of lineno and Curfn.
lineno = pos
Curfn = curfn
return temp(t)
n := temp(t)
Curfn = nil
return n
}

View File

@ -299,6 +299,9 @@ func compile(fn *Node) {
return
}
// From this point, there should be no uses of Curfn. Enforce that.
Curfn = nil
// Build an SSA backend function.
ssafn := buildssa(fn)
if nerrors != 0 {