| 341 | |
| 342 | |
| 343 | int luaD_poscall (lua_State *L, StkId firstResult) { |
| 344 | StkId res; |
| 345 | int wanted, i; |
| 346 | CallInfo *ci; |
| 347 | if (L->hookmask & LUA_MASKRET) |
| 348 | firstResult = callrethooks(L, firstResult); |
| 349 | ci = L->ci--; |
| 350 | res = ci->func; /* res == final position of 1st result */ |
| 351 | wanted = ci->nresults; |
| 352 | L->base = (ci - 1)->base; /* restore base */ |
| 353 | L->savedpc = (ci - 1)->savedpc; /* restore savedpc */ |
| 354 | /* move results to correct place */ |
| 355 | for (i = wanted; i != 0 && firstResult < L->top; i--) |
| 356 | setobjs2s(L, res++, firstResult++); |
| 357 | while (i-- > 0) |
| 358 | setnilvalue(res++); |
| 359 | L->top = res; |
| 360 | return (wanted - LUA_MULTRET); /* 0 iff wanted == LUA_MULTRET */ |
| 361 | } |
| 362 | |
| 363 | |
| 364 | /* |
no test coverage detected