From 84570aa9a18fa46dba1402004a54cedc7cf5e043 Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Fri, 7 Mar 2014 15:11:16 -0500 Subject: runtime: round stack size to power of 2. Fixes build on windows/386 and plan9/386. Fixes #7487. LGTM=mattn.jp, dvyukov, rsc R=golang-codereviews, mattn.jp, dvyukov, 0intro, rsc CC=golang-codereviews https://golang.org/cl/72360043 --- src/pkg/runtime/runtime.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/pkg/runtime/runtime.c') diff --git a/src/pkg/runtime/runtime.c b/src/pkg/runtime/runtime.c index 08a395fbe2..2198bc6850 100644 --- a/src/pkg/runtime/runtime.c +++ b/src/pkg/runtime/runtime.c @@ -3,6 +3,7 @@ // license that can be found in the LICENSE file. #include "runtime.h" +#include "stack.h" #include "arch_GOARCH.h" #include "../../cmd/ld/textflag.h" @@ -256,6 +257,9 @@ runtime·check(void) runtime·throw("float32nan3"); TestAtomic64(); + + if(FixedStack != runtime·round2(FixedStack)) + runtime·throw("FixedStack is not power-of-2"); } uint32 -- cgit v1.3