diff options
Diffstat (limited to 'lcode.c')
-rw-r--r-- | lcode.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lcode.c,v 1.71 2001/06/07 15:01:21 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 1.72 2001/06/08 12:29:27 roberto Exp roberto $ |
3 | ** Code generator for Lua | 3 | ** Code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -261,10 +261,12 @@ static int number_constant (FuncState *fs, lua_Number r) { | |||
261 | 261 | ||
262 | void luaK_setcallreturns (FuncState *fs, expdesc *e, int nresults) { | 262 | void luaK_setcallreturns (FuncState *fs, expdesc *e, int nresults) { |
263 | if (e->k == VCALL) { /* expression is an open function call? */ | 263 | if (e->k == VCALL) { /* expression is an open function call? */ |
264 | SETARG_C(getcode(fs, e), nresults); /* set number of results */ | 264 | int a = GETARG_A(getcode(fs, e)); |
265 | int c = (nresults == LUA_MULTRET) ? NO_REG : a + nresults; | ||
266 | SETARG_C(getcode(fs, e), c); | ||
265 | if (nresults == 1) { /* `regular' expression? */ | 267 | if (nresults == 1) { /* `regular' expression? */ |
266 | e->k = VNONRELOC; | 268 | e->k = VNONRELOC; |
267 | e->u.i.info = GETARG_A(getcode(fs, e)); | 269 | e->u.i.info = a; |
268 | } | 270 | } |
269 | } | 271 | } |
270 | } | 272 | } |