** 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. */
| 603 | ** that. |
| 604 | */ |
| 605 | void luaD_poscall (lua_State *L, CallInfo *ci, int nres) { |
| 606 | l_uint32 fwanted = ci->callstatus & (CIST_TBC | CIST_NRESULTS); |
| 607 | if (l_unlikely(L->hookmask) && !(fwanted & CIST_TBC)) |
| 608 | rethook(L, ci, nres); |
| 609 | /* move results to proper place */ |
| 610 | moveresults(L, ci->func.p, nres, fwanted); |
| 611 | /* function cannot be in any of these cases when returning */ |
| 612 | lua_assert(!(ci->callstatus & |
| 613 | (CIST_HOOKED | CIST_YPCALL | CIST_FIN | CIST_CLSRET))); |
| 614 | L->ci = ci->previous; /* back to caller (after closing variables) */ |
| 615 | } |
| 616 | |
| 617 | |
| 618 |
no test coverage detected