MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / lua_callk

Function lua_callk

third-party/lua-5.2.4/src/lapi.c:889–908  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

887
888
889LUA_API void lua_callk (lua_State *L, int nargs, int nresults, int ctx,
890 lua_CFunction k) {
891 StkId func;
892 lua_lock(L);
893 api_check(L, k == NULL || !isLua(L->ci),
894 "cannot use continuations inside hooks");
895 api_checknelems(L, nargs+1);
896 api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread");
897 checkresults(L, nargs, nresults);
898 func = L->top - (nargs+1);
899 if (k != NULL && L->nny == 0) { /* need to prepare continuation? */
900 L->ci->u.c.k = k; /* save continuation */
901 L->ci->u.c.ctx = ctx; /* save context */
902 luaD_call(L, func, nresults, 1); /* do the call */
903 }
904 else /* no continuation or no yieldable */
905 luaD_call(L, func, nresults, 0); /* just do the call */
906 adjustresults(L, nresults);
907 lua_unlock(L);
908}
909
910
911

Callers 1

luaB_dofileFunction · 0.70

Calls 1

luaD_callFunction · 0.70

Tested by

no test coverage detected