MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / luaD_call

Function luaD_call

Source/Misc/lua/src/lua.c:5515–5526  ·  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

5513** function position.
5514*/
5515void luaD_call (lua_State *L, StkId func, int nResults) {
5516if (++L->nCcalls >= LUAI_MAXCCALLS) {
5517if (L->nCcalls == LUAI_MAXCCALLS)
5518luaG_runerror(L, "C stack overflow");
5519else if (L->nCcalls >= (LUAI_MAXCCALLS + (LUAI_MAXCCALLS>>3)))
5520luaD_throw(L, LUA_ERRERR); /* error while handing stack error */
5521}
5522if (luaD_precall(L, func, nResults) == PCRLUA) /* is a Lua function? */
5523luaV_execute(L, 1); /* call it */
5524L->nCcalls--;
5525luaC_checkGC(L);
5526}
5527
5528
5529static void resume (lua_State *L, void *ud) {

Callers 8

lua_callFunction · 0.85
f_callFunction · 0.85
f_CcallFunction · 0.85
luaG_errormsgFunction · 0.85
GCTMFunction · 0.85
callTMresFunction · 0.85
callTMFunction · 0.85
luaV_executeFunction · 0.85

Calls 4

luaG_runerrorFunction · 0.85
luaD_throwFunction · 0.85
luaD_precallFunction · 0.85
luaV_executeFunction · 0.85

Tested by

no test coverage detected