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