** 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. */
| 457 | ** that. |
| 458 | */ |
| 459 | void luaD_poscall (lua_State *L, CallInfo *ci, int nres) { |
| 460 | int wanted = ci->nresults; |
| 461 | if (l_unlikely(L->hookmask && !hastocloseCfunc(wanted))) |
| 462 | rethook(L, ci, nres); |
| 463 | /* move results to proper place */ |
| 464 | moveresults(L, ci->func, nres, wanted); |
| 465 | /* function cannot be in any of these cases when returning */ |
| 466 | lua_assert(!(ci->callstatus & |
| 467 | (CIST_HOOKED | CIST_YPCALL | CIST_FIN | CIST_TRAN | CIST_CLSRET))); |
| 468 | L->ci = ci->previous; /* back to caller (after closing variables) */ |
| 469 | } |
| 470 | |
| 471 | |
| 472 |
no test coverage detected