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