diff options
author | Benoit Giannangeli <giann008@gmail.com> | 2017-05-29 00:10:10 +0200 |
---|---|---|
committer | Benoit Giannangeli <giann008@gmail.com> | 2017-05-29 00:10:10 +0200 |
commit | b7093cdb38a50fb74eb5fd91dc8e86cfaceb4183 (patch) | |
tree | 7a5c283a2dac6b9c14e831824f4c319ba68e0b89 | |
parent | 303d87f037d59a2486a22d8aa81c3733a6600c1f (diff) | |
download | fengari-b7093cdb38a50fb74eb5fd91dc8e86cfaceb4183.tar.gz fengari-b7093cdb38a50fb74eb5fd91dc8e86cfaceb4183.tar.bz2 fengari-b7093cdb38a50fb74eb5fd91dc8e86cfaceb4183.zip |
Fix bad validop test on lvm.tointeger
-rw-r--r-- | src/lcode.js | 2 |
1 files changed, 1 insertions, 1 deletions
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); |