From 18271b4169631ce8f10c10c0776d9bfb40bd691f Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Mon, 22 May 2017 09:26:03 +0200 Subject: Fixed bad boolean handling in luaV_finishOp --- src/lvm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lvm.js b/src/lvm.js index 4d3d5fb..56be558 100644 --- a/src/lvm.js +++ b/src/lvm.js @@ -43,7 +43,7 @@ const luaV_finishOp = function(L) { if (ci.callstatus & lstate.CIST_LEQ) { /* "<=" using "<" instead? */ assert(op === OCi.OP_LE); ci.callstatus ^= lstate.CIST_LEQ; /* clear mark */ - res = res !== 1 ? 1 : 0; /* negate result */ + res = !res; /* negate result */ } assert(ci.l_code[ci.l_savedpc].opcode === OCi.OP_JMP); if (res !== (inst.A ? true : false)) /* condition failed? */ -- cgit v1.2.3-54-g00ecf