/* 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.  */
void luaD_call(lua_State *L, StkId func, int nResults, int allowyield)
/* 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.  */
void luaD_call(lua_State *L, StkId func, int nResults, int allowyield)
{
    if (L->nCcalls == LUAI_MAXCCALLS)
      luaG_runerror(L, "C stack overflow");
    else if (L->nCcalls >= (LUAI_MAXCCALLS + (LUAI_MAXCCALLS>>3)))
      luaD_throw(L, LUA_ERRERR);
  }
  if (!allowyield) L->nny++;
  if (!luaD_precall(L, func, nResults))
    luaV_execute(L);
  if (!allowyield) L->nny--;
  L->nCcalls--;
}