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

Function luaD_call

third-party/lua-5.2.4/src/ldo.c:393–405  ·  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

391** function position.
392*/
393void luaD_call (lua_State *L, StkId func, int nResults, int allowyield) {
394 if (++L->nCcalls >= LUAI_MAXCCALLS) {
395 if (L->nCcalls == LUAI_MAXCCALLS)
396 luaG_runerror(L, "C stack overflow");
397 else if (L->nCcalls >= (LUAI_MAXCCALLS + (LUAI_MAXCCALLS>>3)))
398 luaD_throw(L, LUA_ERRERR); /* error while handing stack error */
399 }
400 if (!allowyield) L->nny++;
401 if (!luaD_precall(L, func, nResults)) /* is a Lua function? */
402 luaV_execute(L); /* call it */
403 if (!allowyield) L->nny--;
404 L->nCcalls--;
405}
406
407
408static 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 4

luaG_runerrorFunction · 0.70
luaD_throwFunction · 0.70
luaD_precallFunction · 0.70
luaV_executeFunction · 0.70

Tested by

no test coverage detected