** Fix an expression to return the number of results 'nresults'. ** 'e' must be a multi-ret expression (function call or vararg). */
| 706 | ** 'e' must be a multi-ret expression (function call or vararg). |
| 707 | */ |
| 708 | void luaK_setreturns (FuncState *fs, expdesc *e, int nresults) { |
| 709 | Instruction *pc = &getinstruction(fs, e); |
| 710 | if (e->k == VCALL) /* expression is an open function call? */ |
| 711 | SETARG_C(*pc, nresults + 1); |
| 712 | else { |
| 713 | lua_assert(e->k == VVARARG); |
| 714 | SETARG_C(*pc, nresults + 1); |
| 715 | SETARG_A(*pc, fs->freereg); |
| 716 | luaK_reserveregs(fs, 1); |
| 717 | } |
| 718 | } |
| 719 | |
| 720 | |
| 721 | /* |
no test coverage detected