MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaD_poscall

Function luaD_poscall

third-party/lua-5.2.4/src/ldo.c:362–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360
361
362int luaD_poscall (lua_State *L, StkId firstResult) {
363 StkId res;
364 int wanted, i;
365 CallInfo *ci = L->ci;
366 if (L->hookmask & (LUA_MASKRET | LUA_MASKLINE)) {
367 if (L->hookmask & LUA_MASKRET) {
368 ptrdiff_t fr = savestack(L, firstResult); /* hook may change stack */
369 luaD_hook(L, LUA_HOOKRET, -1);
370 firstResult = restorestack(L, fr);
371 }
372 L->oldpc = ci->previous->u.l.savedpc; /* 'oldpc' for caller function */
373 }
374 res = ci->func; /* res == final position of 1st result */
375 wanted = ci->nresults;
376 L->ci = ci = ci->previous; /* back to caller */
377 /* move results to correct place */
378 for (i = wanted; i != 0 && firstResult < L->top; i--)
379 setobjs2s(L, res++, firstResult++);
380 while (i-- > 0)
381 setnilvalue(res++);
382 L->top = res;
383 return (wanted - LUA_MULTRET); /* 0 iff wanted == LUA_MULTRET */
384}
385
386
387/*

Callers 4

luaV_executeFunction · 0.70
luaD_precallFunction · 0.70
finishCcallFunction · 0.70
resumeFunction · 0.70

Calls 1

luaD_hookFunction · 0.70

Tested by

no test coverage detected