1
0
mirror of https://github.com/golang/go synced 2024-11-18 07:04:52 -07:00

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 <bradfitz@golang.org>
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Russ Cox 2015-05-05 21:55:09 -04:00
parent 351897d9d4
commit 8f037fa1ab

View 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