** Finishes a function call: calls hook if necessary, moves current ** number of results to proper place, and returns to previous call ** info. If function has to close variables, hook must be called after ** that. */
| 483 | ** that. |
| 484 | */ |
| 485 | void luaD_poscall (lua_State *L, CallInfo *ci, int nres) { |
| 486 | int wanted = ci->nresults; |
| 487 | if (l_unlikely(L->hookmask && !hastocloseCfunc(wanted))) |
| 488 | rethook(L, ci, nres); |
| 489 | /* move results to proper place */ |
| 490 | moveresults(L, ci->func.p, nres, wanted); |
| 491 | /* function cannot be in any of these cases when returning */ |
| 492 | lua_assert(!(ci->callstatus & |
| 493 | (CIST_HOOKED | CIST_YPCALL | CIST_FIN | CIST_TRAN | CIST_CLSRET))); |
| 494 | L->ci = ci->previous; /* back to caller (after closing variables) */ |
| 495 | } |
| 496 | |
| 497 | |
| 498 |
no test coverage detected