diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-08-29 17:49:21 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-08-29 17:49:21 -0300 |
commit | 3b19af44b05ce5e7f7db3708d052cca25fe6d7d3 (patch) | |
tree | f4575f972c8f780e64d935ff211ebd5cd8f9a3cf /lvm.c | |
parent | 3390f9a35ac66d01c7bb0114083a4cb384783ff5 (diff) | |
download | lua-3b19af44b05ce5e7f7db3708d052cca25fe6d7d3.tar.gz lua-3b19af44b05ce5e7f7db3708d052cca25fe6d7d3.tar.bz2 lua-3b19af44b05ce5e7f7db3708d052cca25fe6d7d3.zip |
new method to handle tests without values (negative values)
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.52 2005/08/22 18:54:49 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.53 2005/08/24 16:15:49 roberto Exp $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -592,6 +592,12 @@ void luaV_execute (lua_State *L, int nexeccalls) { | |||
592 | continue; | 592 | continue; |
593 | } | 593 | } |
594 | case OP_TEST: { | 594 | case OP_TEST: { |
595 | if (l_isfalse(ra) == GETARG_C(i)) pc++; | ||
596 | else | ||
597 | dojump(L, pc, GETARG_sBx(*pc) + 1); | ||
598 | continue; | ||
599 | } | ||
600 | case OP_TESTSET: { | ||
595 | TValue *rb = RB(i); | 601 | TValue *rb = RB(i); |
596 | if (l_isfalse(rb) == GETARG_C(i)) pc++; | 602 | if (l_isfalse(rb) == GETARG_C(i)) pc++; |
597 | else { | 603 | else { |