diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2014-09-26 23:20:01 +0200 |
---|---|---|
committer | Michael Stapelberg <stapelberg@debian.org> | 2014-09-26 23:20:01 +0200 |
commit | f4fa1ef6e6ccd9264db61c6400528158e5913bda (patch) | |
tree | 0d9f077025369138011800c470f68abf72833b31 /src/pkg/runtime/cgocall.c | |
parent | 64f344c0c94601934187163f7b353d009dc1b63f (diff) | |
download | golang-upstream/1.3.2.tar.gz |
Imported Upstream version 1.3.2upstream/1.3.2
Diffstat (limited to 'src/pkg/runtime/cgocall.c')
-rw-r--r-- | src/pkg/runtime/cgocall.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pkg/runtime/cgocall.c b/src/pkg/runtime/cgocall.c index 7b2ec26f3..75d3850ef 100644 --- a/src/pkg/runtime/cgocall.c +++ b/src/pkg/runtime/cgocall.c @@ -234,14 +234,18 @@ void runtime·cgocallbackg1(void); void runtime·cgocallbackg(void) { + uintptr pc, sp; + if(g != m->curg) { runtime·prints("runtime: bad g in cgocallback"); runtime·exit(2); } + pc = g->syscallpc; + sp = g->syscallsp; runtime·exitsyscall(); // coming out of cgo call runtime·cgocallbackg1(); - runtime·entersyscall(); // going back to cgo call + runtime·reentersyscall((void*)pc, sp); // going back to cgo call } void |