summaryrefslogtreecommitdiff
path: root/libgo/go/runtime/lfstack_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/runtime/lfstack_test.go')
-rw-r--r--libgo/go/runtime/lfstack_test.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/libgo/go/runtime/lfstack_test.go b/libgo/go/runtime/lfstack_test.go
index e5187770453..fb4b45992d8 100644
--- a/libgo/go/runtime/lfstack_test.go
+++ b/libgo/go/runtime/lfstack_test.go
@@ -24,9 +24,13 @@ func toMyNode(node *LFNode) *MyNode {
return (*MyNode)(unsafe.Pointer(node))
}
+var global interface{}
+
func TestLFStack(t *testing.T) {
stack := new(uint64)
- // Need to keep additional referenfces to nodes, the stack is not all that type-safe.
+ global = stack // force heap allocation
+
+ // Need to keep additional references to nodes, the stack is not all that type-safe.
var nodes []*MyNode
// Check the stack is initially empty.
@@ -121,7 +125,7 @@ func TestLFStackStress(t *testing.T) {
}
cnt++
sum2 += node.data
- node.Next = nil
+ node.Next = 0
}
}
if cnt != K {