summaryrefslogtreecommitdiff
path: root/src/lvm.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-22 01:15:28 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-22 01:15:28 +1000
commit44779c34305ddc5aa7bf271851f916c6680cdb44 (patch)
treea8658a8a99e88c56ff325992ad8c7d0a76209f74 /src/lvm.js
parent24df35b8e151bf6d0740b9d4ee87708657271587 (diff)
downloadfengari-44779c34305ddc5aa7bf271851f916c6680cdb44.tar.gz
fengari-44779c34305ddc5aa7bf271851f916c6680cdb44.tar.bz2
fengari-44779c34305ddc5aa7bf271851f916c6680cdb44.zip
Use Math.imul when multiplying integers
Diffstat (limited to 'src/lvm.js')
-rw-r--r--src/lvm.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lvm.js b/src/lvm.js
index 3cf406a..e350578 100644
--- a/src/lvm.js
+++ b/src/lvm.js
@@ -242,7 +242,7 @@ const luaV_execute = function(L) {
let numberop2 = tonumber(op2);
if (op1.ttisinteger() && op2.ttisinteger()) {
- L.stack[ra] = new lobject.TValue(CT.LUA_TNUMINT, (op1.value * op2.value)|0);
+ L.stack[ra] = new lobject.TValue(CT.LUA_TNUMINT, Math.imul(op1.value, op2.value));
} else if (numberop1 !== false && numberop2 !== false) {
L.stack[ra] = new lobject.TValue(CT.LUA_TNUMFLT, numberop1 * numberop2);
} else {