From 3b19af44b05ce5e7f7db3708d052cca25fe6d7d3 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 29 Aug 2005 17:49:21 -0300 Subject: new method to handle tests without values (negative values) --- lparser.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lparser.c') diff --git a/lparser.c b/lparser.c index 351340be..15a906c1 100644 --- a/lparser.c +++ b/lparser.c @@ -1,5 +1,5 @@ /* -** $Id: lparser.c,v 2.33 2005/08/22 18:54:32 roberto Exp roberto $ +** $Id: lparser.c,v 2.34 2005/08/24 17:41:10 roberto Exp $ ** Lua Parser ** See Copyright Notice in lua.h */ @@ -375,7 +375,7 @@ static void close_func (LexState *ls) { FuncState *fs = ls->fs; Proto *f = fs->f; removevars(ls, 0); - luaK_codeABC(fs, OP_RETURN, 0, 1, 0); /* final return */ + luaK_ret(fs, 0, 0); /* final return */ luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction); f->sizecode = fs->pc; luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int); @@ -981,7 +981,6 @@ static int cond (LexState *ls) { expdesc v; expr(ls, &v); /* read condition */ if (v.k == VNIL) v.k = VFALSE; /* `falses' are all equal here */ - else if (v.k == VK) v.k = VTRUE; /* 'trues' too */ luaK_goiftrue(ls->fs, &v); return v.f; } @@ -1279,7 +1278,7 @@ static void retstat (LexState *ls) { } } } - luaK_codeABC(fs, OP_RETURN, first, nret+1, 0); + luaK_ret(fs, first, nret); } -- cgit v1.2.3-55-g6feb