From 50104cc32a498f7517a51c8dc93106c51c7a54b4 Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Wed, 20 Apr 2011 15:44:41 +0200 Subject: Imported Upstream version 2011.03.07.1 --- src/pkg/runtime/cgocall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/pkg/runtime/cgocall.c') diff --git a/src/pkg/runtime/cgocall.c b/src/pkg/runtime/cgocall.c index 74e5a3085..741e8f0b8 100644 --- a/src/pkg/runtime/cgocall.c +++ b/src/pkg/runtime/cgocall.c @@ -3,6 +3,7 @@ // license that can be found in the LICENSE file. #include "runtime.h" +#include "stack.h" #include "cgocall.h" void *initcgo; /* filled in by dynamic linker when Cgo is available */ @@ -70,7 +71,7 @@ runtime·cgocallback(void (*fn)(void), void *arg, int32 argsize) runtime·startcgocallback(g1); sp = g1->sched.sp - argsize; - if(sp < g1->stackguard - StackGuard + 8) // +8 for return address + if(sp < g1->stackguard - StackGuard - StackSystem + 8) // +8 for return address runtime·throw("g stack overflow in cgocallback"); runtime·mcpy(sp, arg, argsize); -- cgit v1.2.3