MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaD_poscall

Function luaD_poscall

freebsd/contrib/openzfs/module/lua/ldo.c:432–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430
431
432int luaD_poscall (lua_State *L, StkId firstResult) {
433 StkId res;
434 int wanted, i;
435 CallInfo *ci = L->ci;
436 if (L->hookmask & (LUA_MASKRET | LUA_MASKLINE)) {
437 if (L->hookmask & LUA_MASKRET) {
438 ptrdiff_t fr = savestack(L, firstResult); /* hook may change stack */
439 luaD_hook(L, LUA_HOOKRET, -1);
440 firstResult = restorestack(L, fr);
441 }
442 L->oldpc = ci->previous->u.l.savedpc; /* 'oldpc' for caller function */
443 }
444 res = ci->func; /* res == final position of 1st result */
445 wanted = ci->nresults;
446 L->ci = ci = ci->previous; /* back to caller */
447 /* move results to correct place */
448 for (i = wanted; i != 0 && firstResult < L->top; i--)
449 setobjs2s(L, res++, firstResult++);
450 while (i-- > 0)
451 setnilvalue(res++);
452 L->top = res;
453 return (wanted - LUA_MULTRET); /* 0 iff wanted == LUA_MULTRET */
454}
455
456
457/*

Callers 4

luaV_executeFunction · 0.70
luaD_precallFunction · 0.70
finishCcallFunction · 0.70
resume_cbFunction · 0.70

Calls 1

luaD_hookFunction · 0.85

Tested by

no test coverage detected