]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix TestLFStack on 386
authorRuss Cox <rsc@golang.org>
Wed, 6 May 2015 01:55:09 +0000 (21:55 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 11 May 2015 15:21:54 +0000 (15:21 +0000)
The new(uint64) was moving to the stack, which may not be aligned.

Change-Id: Iad070964202001b52029494d43e299fed980f939
Reviewed-on: https://go-review.googlesource.com/9787
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/runtime/lfstack_test.go

index 68f221d6ef85116be7aa60d8d7cd8b25c39049a2..4da4d88619ae65fad3bf27e63d112b3c61eeaf6d 100644 (file)
@@ -24,8 +24,12 @@ func toMyNode(node *LFNode) *MyNode {
        return (*MyNode)(unsafe.Pointer(node))
 }
 
+var global interface{}
+
 func TestLFStack(t *testing.T) {
        stack := new(uint64)
+       global = stack // force heap allocation
+
        // Need to keep additional referenfces to nodes, the stack is not all that type-safe.
        var nodes []*MyNode