| 5486 | |
| 5487 | |
| 5488 | int luaD_poscall (lua_State *L, StkId firstResult) { |
| 5489 | StkId res; |
| 5490 | int wanted, i; |
| 5491 | CallInfo *ci; |
| 5492 | if (L->hookmask & LUA_MASKRET) |
| 5493 | firstResult = callrethooks(L, firstResult); |
| 5494 | ci = L->ci--; |
| 5495 | res = ci->func; /* res == final position of 1st result */ |
| 5496 | wanted = ci->nresults; |
| 5497 | L->base = (ci - 1)->base; /* restore base */ |
| 5498 | L->savedpc = (ci - 1)->savedpc; /* restore savedpc */ |
| 5499 | /* move results to correct place */ |
| 5500 | for (i = wanted; i != 0 && firstResult < L->top; i--) |
| 5501 | setobjs2s(L, res++, firstResult++); |
| 5502 | while (i-- > 0) |
| 5503 | setnilvalue(res++); |
| 5504 | L->top = res; |
| 5505 | return (wanted - LUA_MULTRET); /* 0 iff wanted == LUA_MULTRET */ |
| 5506 | } |
| 5507 | |
| 5508 | |
| 5509 | /* |
no test coverage detected