From b7093cdb38a50fb74eb5fd91dc8e86cfaceb4183 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Mon, 29 May 2017 00:10:10 +0200 Subject: Fix bad validop test on lvm.tointeger --- src/lcode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lcode.js b/src/lcode.js index 8dbff2b..60b7452 100644 --- a/src/lcode.js +++ b/src/lcode.js @@ -950,7 +950,7 @@ const validop = function(op, v1, v2) { switch (op) { case defs.LUA_OPBAND: case defs.LUA_OPBOR: case defs.LUA_OPBXOR: case defs.LUA_OPSHL: case defs.LUA_OPSHR: case defs.LUA_OPBNOT: { /* conversion errors */ - return (lvm.tointeger(v1) && lvm.tointeger(v2)); + return (lvm.tointeger(v1) !== false && lvm.tointeger(v2) !== false); } case defs.LUA_OPDIV: case defs.LUA_OPIDIV: case defs.LUA_OPMOD: /* division by 0 */ return (v2.value !== 0); -- cgit v1.2.3-70-g09d2