diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-22 01:15:28 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-22 01:15:28 +1000 |
commit | 44779c34305ddc5aa7bf271851f916c6680cdb44 (patch) | |
tree | a8658a8a99e88c56ff325992ad8c7d0a76209f74 /src/lobject.js | |
parent | 24df35b8e151bf6d0740b9d4ee87708657271587 (diff) | |
download | fengari-44779c34305ddc5aa7bf271851f916c6680cdb44.tar.gz fengari-44779c34305ddc5aa7bf271851f916c6680cdb44.tar.bz2 fengari-44779c34305ddc5aa7bf271851f916c6680cdb44.zip |
Use Math.imul when multiplying integers
Diffstat (limited to 'src/lobject.js')
-rw-r--r-- | src/lobject.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lobject.js b/src/lobject.js index 5d3a984..6ba225d 100644 --- a/src/lobject.js +++ b/src/lobject.js @@ -525,7 +525,7 @@ const intarith = function(L, op, v1, v2) { switch (op) { case defs.LUA_OPADD: return (v1 + v2)|0; case defs.LUA_OPSUB: return (v1 - v2)|0; - case defs.LUA_OPMUL: return (v1 * v2)|0; + case defs.LUA_OPMUL: return Math.imul(v1, v2); case defs.LUA_OPMOD: return lvm.luaV_mod(L, v1, v2); case defs.LUA_OPIDIV: return lvm.luaV_div(L, v1, v2); case defs.LUA_OPBAND: return (v1 & v2); |