MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / luaD_poscall

Function luaD_poscall

src/Chain/libraries/glua/ldo.cpp:484–499  ·  view source on GitHub ↗

** 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. */

Source from the content-addressed store, hash-verified

482** wanted multiple (variable number of) results.
483*/
484int luaD_poscall(lua_State *L, CallInfo *ci, StkId firstResult, int nres) {
485 StkId res;
486 int wanted = ci->nresults;
487 if (L->hookmask & (LUA_MASKRET | LUA_MASKLINE)) {
488 if (L->hookmask & LUA_MASKRET) {
489 ptrdiff_t fr = savestack(L, firstResult); /* hook may change stack */
490 luaD_hook(L, LUA_HOOKRET, -1);
491 firstResult = restorestack(L, fr);
492 }
493 L->oldpc = ci->previous->u.l.savedpc; /* 'oldpc' for caller function */
494 }
495 res = ci->func; /* res == final position of 1st result */
496 L->ci = ci->previous; /* back to caller */
497 /* move results to proper place */
498 return moveresults(L, firstResult, res, nres, wanted);
499}
500
501
502/*

Callers 4

ldo.cppFile · 0.85
finishCcallFunction · 0.85
resumeFunction · 0.85
vmcaseFunction · 0.85

Calls 2

luaD_hookFunction · 0.85
moveresultsFunction · 0.85

Tested by

no test coverage detected