diff options
-rw-r--r-- | libcr/coroutine.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libcr/coroutine.c b/libcr/coroutine.c index 45dcb39..726b732 100644 --- a/libcr/coroutine.c +++ b/libcr/coroutine.c @@ -721,6 +721,8 @@ void cr_cid_info(cid_t cid, struct cr_cid_info *ret) { uintptr_t sp; if (cid == coroutine_running) sp = cr_plat_get_sp(); + else if (coroutine_table[cid-1].state == CR_RUNNING) + sp = coroutine_add_env.sp; else sp = coroutine_table[cid-1].env.sp; assert(sp); |