MCPcopy Create free account
hub / github.com/DFHack/dfhack / unroll

Function unroll

depends/lua/src/ldo.c:548–559  ·  view source on GitHub ↗

** Executes "full continuation" (everything in the stack) of a ** previously interrupted coroutine until the stack is empty (or another ** interruption long-jumps out of the loop). If the coroutine is ** recovering from an error, 'ud' points to the error status, which must ** be passed to the first continuation function (otherwise the default ** status is LUA_YIELD). */

Source from the content-addressed store, hash-verified

546** status is LUA_YIELD).
547*/
548static void unroll (lua_State *L, void *ud) {
549 if (ud != NULL) /* error status? */
550 finishCcall(L, *(int *)ud); /* finish 'lua_pcallk' callee */
551 while (L->ci != &L->base_ci) { /* something in the stack */
552 if (!isLua(L->ci)) /* C function? */
553 finishCcall(L, LUA_YIELD); /* complete its execution */
554 else { /* Lua function */
555 luaV_finishOp(L); /* finish interrupted instruction */
556 luaV_execute(L); /* execute down to higher C 'boundary' */
557 }
558 }
559}
560
561
562/*

Callers 1

resumeFunction · 0.85

Calls 3

finishCcallFunction · 0.85
luaV_finishOpFunction · 0.85
luaV_executeFunction · 0.85

Tested by

no test coverage detected