From 8f037fa1ab223f48750117219cd4fff8c6575970 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 5 May 2015 21:55:09 -0400 Subject: [PATCH] runtime: fix TestLFStack on 386 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 Reviewed-by: David Chase --- src/runtime/lfstack_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime/lfstack_test.go b/src/runtime/lfstack_test.go index 68f221d6ef..4da4d88619 100644 --- a/src/runtime/lfstack_test.go +++ b/src/runtime/lfstack_test.go @@ -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 -- 2.48.1