MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaD_call

Function luaD_call

freebsd/contrib/openzfs/module/lua/ldo.c:463–480  ·  view source on GitHub ↗

** Call a function (C or Lua). The function to be called is at *func. ** The arguments are on the stack, right after the function. ** When returns, all the results are on the stack, starting at the original ** function position. */

Source from the content-addressed store, hash-verified

461** function position.
462*/
463void luaD_call (lua_State *L, StkId func, int nResults, int allowyield) {
464 if (++L->nCcalls >= LUAI_MAXCCALLS) {
465 if (L->nCcalls == LUAI_MAXCCALLS)
466 luaG_runerror(L, "C stack overflow");
467 else if (L->nCcalls >= (LUAI_MAXCCALLS + (LUAI_MAXCCALLS>>3)))
468 luaD_throw(L, LUA_ERRERR); /* error while handling stack error */
469 }
470 intptr_t remaining = stack_remaining();
471 if (L->runerror == 0 && remaining < LUAI_MINCSTACK)
472 luaG_runerror(L, "C stack overflow");
473 if (L->runerror != 0 && remaining < LUAI_MINCSTACK / 2)
474 luaD_throw(L, LUA_ERRERR); /* error while handling stack error */
475 if (!allowyield) L->nny++;
476 if (!luaD_precall(L, func, nResults)) /* is a Lua function? */
477 luaV_execute(L); /* call it */
478 if (!allowyield) L->nny--;
479 L->nCcalls--;
480}
481
482
483static void finishCcall (lua_State *L) {

Callers 7

callTMFunction · 0.70
luaV_executeFunction · 0.70
luaG_errormsgFunction · 0.70
lua_callkFunction · 0.70
f_callFunction · 0.70
lua_pcallkFunction · 0.70
dothecallFunction · 0.70

Calls 5

stack_remainingFunction · 0.85
luaG_runerrorFunction · 0.70
luaD_throwFunction · 0.70
luaD_precallFunction · 0.70
luaV_executeFunction · 0.70

Tested by

no test coverage detected