** Fix an expression to return the number of results 'nresults'. ** 'e' must be a multi-ret expression (function call or vararg). */
| 719 | ** 'e' must be a multi-ret expression (function call or vararg). |
| 720 | */ |
| 721 | void luaK_setreturns (FuncState *fs, expdesc *e, int nresults) { |
| 722 | Instruction *pc = &getinstruction(fs, e); |
| 723 | if (e->k == VCALL) /* expression is an open function call? */ |
| 724 | SETARG_C(*pc, nresults + 1); |
| 725 | else { |
| 726 | lua_assert(e->k == VVARARG); |
| 727 | SETARG_C(*pc, nresults + 1); |
| 728 | SETARG_A(*pc, fs->freereg); |
| 729 | luaK_reserveregs(fs, 1); |
| 730 | } |
| 731 | } |
| 732 | |
| 733 | |
| 734 | /* |
no test coverage detected