From cbc59592ff684b646b21766a66630df1f7974b25 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 8 Jun 2001 16:01:38 -0300 Subject: new definition for `luaD_call' and `luaD_adjusttop' --- lcode.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lcode.c') diff --git a/lcode.c b/lcode.c index e869dac3..ad0c05d2 100644 --- a/lcode.c +++ b/lcode.c @@ -1,5 +1,5 @@ /* -** $Id: lcode.c,v 1.71 2001/06/07 15:01:21 roberto Exp roberto $ +** $Id: lcode.c,v 1.72 2001/06/08 12:29:27 roberto Exp roberto $ ** Code generator for Lua ** See Copyright Notice in lua.h */ @@ -261,10 +261,12 @@ static int number_constant (FuncState *fs, lua_Number r) { void luaK_setcallreturns (FuncState *fs, expdesc *e, int nresults) { if (e->k == VCALL) { /* expression is an open function call? */ - SETARG_C(getcode(fs, e), nresults); /* set number of results */ + int a = GETARG_A(getcode(fs, e)); + int c = (nresults == LUA_MULTRET) ? NO_REG : a + nresults; + SETARG_C(getcode(fs, e), c); if (nresults == 1) { /* `regular' expression? */ e->k = VNONRELOC; - e->u.i.info = GETARG_A(getcode(fs, e)); + e->u.i.info = a; } } } -- cgit v1.2.3-55-g6feb