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