diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-02-18 09:50:58 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-02-18 09:50:58 +0100 |
commit | c072558b90f1bbedc2022b0f30c8b1ac4712538e (patch) | |
tree | 67767591619e4bd8111fb05fac185cde94fb7378 /src/pkg/runtime/cgocall.c | |
parent | 5859517b767c99749a45651c15d4bae5520ebae8 (diff) | |
download | golang-upstream/2011.02.15.tar.gz |
Imported Upstream version 2011.02.15upstream/2011.02.15
Diffstat (limited to 'src/pkg/runtime/cgocall.c')
-rw-r--r-- | src/pkg/runtime/cgocall.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/pkg/runtime/cgocall.c b/src/pkg/runtime/cgocall.c index e6ece9542..74e5a3085 100644 --- a/src/pkg/runtime/cgocall.c +++ b/src/pkg/runtime/cgocall.c @@ -53,13 +53,12 @@ runtime·cgocall(void (*fn)(void*), void *arg) // (arg/argsize) on to the stack, calls the function, copies the // arguments back where they came from, and finally returns to the old // stack. -uintptr +void runtime·cgocallback(void (*fn)(void), void *arg, int32 argsize) { Gobuf oldsched, oldg1sched; G *g1; void *sp; - uintptr ret; if(g != m->g0) runtime·throw("bad g in cgocallback"); @@ -71,11 +70,11 @@ runtime·cgocallback(void (*fn)(void), void *arg, int32 argsize) runtime·startcgocallback(g1); sp = g1->sched.sp - argsize; - if(sp < g1->stackguard - StackGuard + 4) // +4 for return address + if(sp < g1->stackguard - StackGuard + 8) // +8 for return address runtime·throw("g stack overflow in cgocallback"); runtime·mcpy(sp, arg, argsize); - ret = runtime·runcgocallback(g1, sp, fn); + runtime·runcgocallback(g1, sp, fn); runtime·mcpy(arg, sp, argsize); @@ -83,8 +82,6 @@ runtime·cgocallback(void (*fn)(void), void *arg, int32 argsize) m->sched = oldsched; g1->sched = oldg1sched; - - return ret; } void |