/* Finishes a function call: calls hook if necessary, removes CallInfo, moves current number of results to proper place; returns 0 iff call wanted multiple (variable number of) results.  */
int luaD_poscall(lua_State *L, CallInfo *ci, StkId firstResult, int nres)
/* Finishes a function call: calls hook if necessary, removes CallInfo, moves current number of results to proper place; returns 0 iff call wanted multiple (variable number of) results.  */
int luaD_poscall(lua_State *L, CallInfo *ci, StkId firstResult, int nres)
{
    if (L->hookmask & LUA_MASKRET) {
      ptrdiff_t fr = savestack(L, firstResult);
      luaD_hook(L, LUA_HOOKRET, -1);
      firstResult = restorestack(L, fr);
    }
    L->oldpc = ci->previous->u.l.savedpc;
  }
  res = ci->func;
  L->ci = ci->previous;
  return moveresults(L, firstResult, res, nres, wanted);
}