** Recovers from an error in a coroutine. Finds a recover point (if ** there is one) and completes the execution of the interrupted ** 'luaD_pcall'. If there is no recover point, returns zero. */
| 579 | ** 'luaD_pcall'. If there is no recover point, returns zero. |
| 580 | */ |
| 581 | static int recover (lua_State *L, int status) { |
| 582 | StkId oldtop; |
| 583 | CallInfo *ci = findpcall(L); |
| 584 | if (ci == NULL) return 0; /* no recovery point */ |
| 585 | /* "finish" luaD_pcall */ |
| 586 | oldtop = restorestack(L, ci->extra); |
| 587 | luaF_close(L, oldtop); |
| 588 | seterrorobj(L, status, oldtop); |
| 589 | L->ci = ci; |
| 590 | L->allowhook = getoah(ci->callstatus); /* restore original 'allowhook' */ |
| 591 | L->nny = 0; /* should be zero to be yieldable */ |
| 592 | luaD_shrinkstack(L); |
| 593 | L->errfunc = ci->u.c.old_errfunc; |
| 594 | return 1; /* continue running the coroutine */ |
| 595 | } |
| 596 | |
| 597 | |
| 598 | /* |
no test coverage detected