aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-05-29 00:10:10 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-05-29 00:10:10 +0200
commitb7093cdb38a50fb74eb5fd91dc8e86cfaceb4183 (patch)
tree7a5c283a2dac6b9c14e831824f4c319ba68e0b89 /src
parent303d87f037d59a2486a22d8aa81c3733a6600c1f (diff)
downloadfengari-b7093cdb38a50fb74eb5fd91dc8e86cfaceb4183.tar.gz
fengari-b7093cdb38a50fb74eb5fd91dc8e86cfaceb4183.tar.bz2
fengari-b7093cdb38a50fb74eb5fd91dc8e86cfaceb4183.zip
Fix bad validop test on lvm.tointeger
Diffstat (limited to 'src')
-rw-r--r--src/lcode.js2
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);