summaryrefslogtreecommitdiff
path: root/src/lobject.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-21 18:50:24 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-21 19:12:47 +1000
commitd229ba6542aa009185b28530c55887d14c76b163 (patch)
tree2ac878961644dfaab23850c803890b4b94aa54a4 /src/lobject.js
parent02cb89ce61c58e0d9281a6fd163375399aaed40e (diff)
downloadfengari-d229ba6542aa009185b28530c55887d14c76b163.tar.gz
fengari-d229ba6542aa009185b28530c55887d14c76b163.tar.bz2
fengari-d229ba6542aa009185b28530c55887d14c76b163.zip
shifts have different semantics to JS, use add luaV_shiftl
Diffstat (limited to 'src/lobject.js')
-rw-r--r--src/lobject.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lobject.js b/src/lobject.js
index d6ced0b..ec88e34 100644
--- a/src/lobject.js
+++ b/src/lobject.js
@@ -527,8 +527,8 @@ const intarith = function(L, op, v1, v2) {
case defs.LUA_OPBAND: return (v1 & v2);
case defs.LUA_OPBOR: return (v1 | v2);
case defs.LUA_OPBXOR: return (v1 ^ v2);
- case defs.LUA_OPSHL: return (v1 << v2);
- case defs.LUA_OPSHR: return (v1 >>> v2)|0;
+ case defs.LUA_OPSHL: return lvm.luaV_shiftl(v1, v2);
+ case defs.LUA_OPSHR: return lvm.luaV_shiftl(v1, -v2);
case defs.LUA_OPUNM: return (0 - v1)|0;
case defs.LUA_OPBNOT: return (~0 ^ v1);
default: assert(0);