Commit ef1ab0f0 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 34975095
......@@ -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
}
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment