MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / resume

Function resume

lua/ldo.c:391–413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389
390
391static void resume (lua_State *L, void *ud) {
392 StkId firstArg = cast(StkId, ud);
393 CallInfo *ci = L->ci;
394 if (L->status == 0) { /* start coroutine? */
395 lua_assert(ci == L->base_ci && firstArg > L->base);
396 if (luaD_precall(L, firstArg - 1, LUA_MULTRET) != PCRLUA)
397 return;
398 }
399 else { /* resuming from previous yield */
400 lua_assert(L->status == LUA_YIELD);
401 L->status = 0;
402 if (!f_isLua(ci)) { /* `common' yield? */
403 /* finish interrupted execution of `OP_CALL' */
404 lua_assert(GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_CALL ||
405 GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_TAILCALL);
406 if (luaD_poscall(L, firstArg)) /* complete it... */
407 L->top = L->ci->top; /* and correct top if not multiple results */
408 }
409 else /* yielded inside a hook: just continue its execution */
410 L->base = L->ci->base;
411 }
412 luaV_execute(L, cast_int(L->ci - L->base_ci));
413}
414
415
416static int resume_error (lua_State *L, const char *msg) {

Callers

nothing calls this directly

Calls 3

luaD_precallFunction · 0.85
luaD_poscallFunction · 0.85
luaV_executeFunction · 0.85

Tested by

no test coverage detected