** Completes the execution of an interrupted C function, calling its ** continuation function. */
| 533 | ** continuation function. |
| 534 | */ |
| 535 | static void finishCcall (lua_State *L, int status) { |
| 536 | CallInfo *ci = L->ci; |
| 537 | int n; |
| 538 | /* must have a continuation and must be able to call it */ |
| 539 | lua_assert(ci->u.c.k != NULL && yieldable(L)); |
| 540 | /* error status can only happen in a protected call */ |
| 541 | lua_assert((ci->callstatus & CIST_YPCALL) || status == LUA_YIELD); |
| 542 | if (ci->callstatus & CIST_YPCALL) { /* was inside a pcall? */ |
| 543 | ci->callstatus &= ~CIST_YPCALL; /* continuation is also inside it */ |
| 544 | L->errfunc = ci->u.c.old_errfunc; /* with the same error function */ |
| 545 | } |
| 546 | /* finish 'lua_callk'/'lua_pcall'; CIST_YPCALL and 'errfunc' already |
| 547 | handled */ |
| 548 | adjustresults(L, ci->nresults); |
| 549 | lua_unlock(L); |
| 550 | n = (*ci->u.c.k)(L, status, ci->u.c.ctx); /* call continuation function */ |
| 551 | lua_lock(L); |
| 552 | api_checknelems(L, n); |
| 553 | luaD_poscall(L, ci, n); /* finish 'luaD_call' */ |
| 554 | } |
| 555 | |
| 556 | |
| 557 | /* |
no test coverage detected