diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-08 16:01:38 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-08 16:01:38 -0300 |
commit | cbc59592ff684b646b21766a66630df1f7974b25 (patch) | |
tree | 1e28529cda3b8f6baa63285f6a2571767c3ed05e /lcode.c | |
parent | 4905fdd1350bde68cd818b9198f28f5a47c208b0 (diff) | |
download | lua-cbc59592ff684b646b21766a66630df1f7974b25.tar.gz lua-cbc59592ff684b646b21766a66630df1f7974b25.tar.bz2 lua-cbc59592ff684b646b21766a66630df1f7974b25.zip |
new definition for `luaD_call' and `luaD_adjusttop'
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 | } |