Commit 129261ae authored by Keith Randall's avatar Keith Randall

[dev.ssa] cmd/compile: give GetClosurePtr pointer type

If the closure pointer gets spilled, we need to spill it with
pointer type to make stack copy and GC happy.

Change-Id: Ic108748e6b9caecd45522141f02c9422567376e3
Reviewed-on: https://go-review.googlesource.com/16363
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: 's avatarDavid Chase <drchase@google.com>
parent 10462eb3
......@@ -2335,7 +2335,7 @@ func (s *state) addr(n *Node, bounded bool) *ssa.Value {
return s.newValue2(ssa.OpAddPtr, p.Type, p, s.constIntPtr(Types[TUINTPTR], n.Xoffset))
case OCLOSUREVAR:
return s.newValue2(ssa.OpAddPtr, Ptrto(n.Type),
s.entryNewValue0(ssa.OpGetClosurePtr, Types[TUINTPTR]),
s.entryNewValue0(ssa.OpGetClosurePtr, Ptrto(Types[TUINT8])),
s.constIntPtr(Types[TUINTPTR], n.Xoffset))
case OPARAM:
p := n.Left
......
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