new method to handle tests without values (negative values)

This commit is contained in:
Roberto Ierusalimschy
2005-08-29 17:49:21 -03:00
parent 3390f9a35a
commit 3b19af44b0
6 changed files with 58 additions and 40 deletions

8
lvm.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lvm.c,v 2.52 2005/08/22 18:54:49 roberto Exp roberto $
** $Id: lvm.c,v 2.53 2005/08/24 16:15:49 roberto Exp $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -592,6 +592,12 @@ void luaV_execute (lua_State *L, int nexeccalls) {
continue;
}
case OP_TEST: {
if (l_isfalse(ra) == GETARG_C(i)) pc++;
else
dojump(L, pc, GETARG_sBx(*pc) + 1);
continue;
}
case OP_TESTSET: {
TValue *rb = RB(i);
if (l_isfalse(rb) == GETARG_C(i)) pc++;
else {