mirror of
https://github.com/golang/go
synced 2024-11-23 22:50:05 -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:
parent
34975095d0
commit
ef1ab0f0f4
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user