From 6c042e17b15f1381296a7ec1cd207741ade71170 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 19 Jun 2007 16:48:15 -0300 Subject: [PATCH] avoid boolean equality (tricky for some compilers) --- lvm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lvm.c b/lvm.c index 15c7a6ac..054327a7 100644 --- a/lvm.c +++ b/lvm.c @@ -1,5 +1,5 @@ /* -** $Id: lvm.c,v 2.70 2007/02/09 13:04:52 roberto Exp roberto $ +** $Id: lvm.c,v 2.71 2007/03/26 15:56:23 roberto Exp roberto $ ** Lua virtual machine ** See Copyright Notice in lua.h */ @@ -566,14 +566,14 @@ void luaV_execute (lua_State *L, int nexeccalls) { continue; } case OP_TEST: { - if (l_isfalse(ra) != GETARG_C(i)) + if (GETARG_C(i) ? !l_isfalse(ra) : l_isfalse(ra)) dojump(L, GETARG_sBx(*L->savedpc)); L->savedpc++; continue; } case OP_TESTSET: { TValue *rb = RB(i); - if (l_isfalse(rb) != GETARG_C(i)) { + if (GETARG_C(i) ? !l_isfalse(rb) : l_isfalse(rb)) { setobjs2s(L, ra, rb); dojump(L, GETARG_sBx(*L->savedpc)); }