diff options
Diffstat (limited to 'lcode.c')
| -rw-r--r-- | lcode.c | 7 |
1 files changed, 3 insertions, 4 deletions
| @@ -703,19 +703,18 @@ static void const2exp (TValue *v, expdesc *e) { | |||
| 703 | 703 | ||
| 704 | /* | 704 | /* |
| 705 | ** Fix an expression to return the number of results 'nresults'. | 705 | ** Fix an expression to return the number of results 'nresults'. |
| 706 | ** Either 'e' is a multi-ret expression (function call or vararg) | 706 | ** 'e' must be a multi-ret expression (function call or vararg). |
| 707 | ** or 'nresults' is LUA_MULTRET (as any expression can satisfy that). | ||
| 708 | */ | 707 | */ |
| 709 | void luaK_setreturns (FuncState *fs, expdesc *e, int nresults) { | 708 | void luaK_setreturns (FuncState *fs, expdesc *e, int nresults) { |
| 710 | Instruction *pc = &getinstruction(fs, e); | 709 | Instruction *pc = &getinstruction(fs, e); |
| 711 | if (e->k == VCALL) /* expression is an open function call? */ | 710 | if (e->k == VCALL) /* expression is an open function call? */ |
| 712 | SETARG_C(*pc, nresults + 1); | 711 | SETARG_C(*pc, nresults + 1); |
| 713 | else if (e->k == VVARARG) { | 712 | else { |
| 713 | lua_assert(e->k == VVARARG); | ||
| 714 | SETARG_C(*pc, nresults + 1); | 714 | SETARG_C(*pc, nresults + 1); |
| 715 | SETARG_A(*pc, fs->freereg); | 715 | SETARG_A(*pc, fs->freereg); |
| 716 | luaK_reserveregs(fs, 1); | 716 | luaK_reserveregs(fs, 1); |
| 717 | } | 717 | } |
| 718 | else lua_assert(nresults == LUA_MULTRET); | ||
| 719 | } | 718 | } |
| 720 | 719 | ||
| 721 | 720 | ||
