MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / luaD_poscall

Function luaD_poscall

libraries/AP_Scripting/lua/src/ldo.c:385–400  ·  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

383** wanted multiple (variable number of) results.
384*/
385int luaD_poscall (lua_State *L, CallInfo *ci, StkId firstResult, int nres) {
386 StkId res;
387 int wanted = ci->nresults;
388 if (L->hookmask & (LUA_MASKRET | LUA_MASKLINE)) {
389 if (L->hookmask & LUA_MASKRET) {
390 ptrdiff_t fr = savestack(L, firstResult); /* hook may change stack */
391 luaD_hook(L, LUA_HOOKRET, -1);
392 firstResult = restorestack(L, fr);
393 }
394 L->oldpc = ci->previous->u.l.savedpc; /* 'oldpc' for caller function */
395 }
396 res = ci->func; /* res == final position of 1st result */
397 L->ci = ci->previous; /* back to caller */
398 /* move results to proper place */
399 return moveresults(L, firstResult, res, nres, wanted);
400}
401
402
403

Callers 4

luaV_executeFunction · 0.85
luaD_precallFunction · 0.85
finishCcallFunction · 0.85
resumeFunction · 0.85

Calls 2

luaD_hookFunction · 0.85
moveresultsFunction · 0.85

Tested by

no test coverage detected