MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / recover

Function recover

extlibs/lua/src/ldo.c:599–613  ·  view source on GitHub ↗

** 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. */

Source from the content-addressed store, hash-verified

597** 'luaD_pcall'. If there is no recover point, returns zero.
598*/
599static int recover (lua_State *L, int status) {
600 StkId oldtop;
601 CallInfo *ci = findpcall(L);
602 if (ci == NULL) return 0; /* no recovery point */
603 /* "finish" luaD_pcall */
604 oldtop = restorestack(L, ci->u2.funcidx);
605 luaF_close(L, oldtop, status); /* may change the stack */
606 oldtop = restorestack(L, ci->u2.funcidx);
607 luaD_seterrorobj(L, status, oldtop);
608 L->ci = ci;
609 L->allowhook = getoah(ci->callstatus); /* restore original 'allowhook' */
610 luaD_shrinkstack(L);
611 L->errfunc = ci->u.c.old_errfunc;
612 return 1; /* continue running the coroutine */
613}
614
615
616/*

Callers 1

lua_resumeFunction · 0.85

Calls 4

findpcallFunction · 0.85
luaF_closeFunction · 0.85
luaD_seterrorobjFunction · 0.85
luaD_shrinkstackFunction · 0.85

Tested by

no test coverage detected