summaryrefslogtreecommitdiff
path: root/coro.c
diff options
context:
space:
mode:
Diffstat (limited to 'coro.c')
-rw-r--r--coro.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/coro.c b/coro.c
index 20266e7..909f396 100644
--- a/coro.c
+++ b/coro.c
@@ -326,9 +326,14 @@ void coro_create (coro_context *ctx,
# elif CORO_ASM
ctx->sp = (volatile void **)(ssize + (char *)sptr);
+ /* we try to allow for both functions with and without frame pointers */
*--ctx->sp = (void *)coro_init;
- *--ctx->sp = (void *)coro_init; // this is needed when the prologue saves ebp
- ctx->sp -= NUM_SAVED;
+ {
+ void **frame = ctx->sp - 1;
+ int i;
+ for (i = NUM_SAVED; i--; )
+ *--ctx->sp = frame;
+ }
# endif