MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / luaD_call

Function luaD_call

other_src/lua/src/ldo.cpp:369–380  ·  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

367** function position.
368*/
369void luaD_call (lua_State *L, StkId func, int nResults) {
370 if (++L->nCcalls >= LUAI_MAXCCALLS) {
371 if (L->nCcalls == LUAI_MAXCCALLS)
372 luaG_runerror(L, "C stack overflow");
373 else if (L->nCcalls >= (LUAI_MAXCCALLS + (LUAI_MAXCCALLS>>3)))
374 luaD_throw(L, LUA_ERRERR); /* error while handing stack error */
375 }
376 if (luaD_precall(L, func, nResults) == PCRLUA) /* is a Lua function? */
377 luaV_execute(L, 1); /* call it */
378 L->nCcalls--;
379 luaC_checkGC(L);
380}
381
382
383static void resume (lua_State *L, void *ud) {

Callers 8

luaG_errormsgFunction · 0.70
callTMresFunction · 0.70
callTMFunction · 0.70
luaV_executeFunction · 0.70
GCTMFunction · 0.70
lua_callFunction · 0.70
f_callFunction · 0.70
f_CcallFunction · 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