** 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). */
| 563 | ** status is LUA_YIELD). |
| 564 | */ |
| 565 | static void unroll (lua_State *L, void *ud) { |
| 566 | CallInfo *ci; |
| 567 | if (ud != NULL) /* error status? */ |
| 568 | finishCcall(L, *(int *)ud); /* finish 'lua_pcallk' callee */ |
| 569 | while ((ci = L->ci) != &L->base_ci) { /* something in the stack */ |
| 570 | if (!isLua(ci)) /* C function? */ |
| 571 | finishCcall(L, LUA_YIELD); /* complete its execution */ |
| 572 | else { /* Lua function */ |
| 573 | luaV_finishOp(L); /* finish interrupted instruction */ |
| 574 | luaV_execute(L, ci); /* execute down to higher C 'boundary' */ |
| 575 | } |
| 576 | } |
| 577 | } |
| 578 | |
| 579 | |
| 580 | /* |
no test coverage detected