]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.ssa] cmd/compile: give GetClosurePtr pointer type
authorKeith Randall <khr@golang.org>
Tue, 27 Oct 2015 17:15:02 +0000 (10:15 -0700)
committerKeith Randall <khr@golang.org>
Tue, 27 Oct 2015 18:00:31 +0000 (18:00 +0000)
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: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/ssa.go

index 96c9a5fc9ca3df6806d21c73b56c362feff2c466..d4001146b6da00a8d71ff2d09150522e8449ab23 100644 (file)
@@ -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