--- libcoro/coro.c 2008/07/16 00:47:05 1.32 +++ libcoro/coro.c 2008/10/30 09:44:31 1.33 @@ -326,9 +326,14 @@ # 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