** 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. */
| 391 | ** function position. |
| 392 | */ |
| 393 | void 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 | |
| 408 | static void finishCcall (lua_State *L) { |
no test coverage detected