summaryrefslogtreecommitdiff
path: root/src/lvm.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-05-20 17:58:00 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-05-20 17:58:00 +0200
commit1b55793f38dcf088c2ab4b5cc9d7e75eb70ed7f7 (patch)
treef926a84a9a9e66ed103363a0c72a017b86061863 /src/lvm.js
parent4a8b0d23a798b03c5fa2edd61313b0747b1068a0 (diff)
downloadfengari-1b55793f38dcf088c2ab4b5cc9d7e75eb70ed7f7.tar.gz
fengari-1b55793f38dcf088c2ab4b5cc9d7e75eb70ed7f7.tar.bz2
fengari-1b55793f38dcf088c2ab4b5cc9d7e75eb70ed7f7.zip
Use >>> instead of >>
Diffstat (limited to 'src/lvm.js')
-rw-r--r--src/lvm.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lvm.js b/src/lvm.js
index 35a4a51..6bc5377 100644
--- a/src/lvm.js
+++ b/src/lvm.js
@@ -365,7 +365,8 @@ const luaV_execute = function(L) {
let numberop2 = tointeger(op2);
if (numberop1 !== false && numberop2 !== false) {
- L.stack[ra] = new lobject.TValue(CT.LUA_TNUMINT, (numberop1 >> numberop2));
+ // >>> to have same overflow semantic as lua
+ L.stack[ra] = new lobject.TValue(CT.LUA_TNUMINT, (numberop1 >>> numberop2)|0);
} else {
ltm.luaT_trybinTM(L, op1, op2, ra, ltm.TMS.TM_SHR);
}
@@ -386,7 +387,6 @@ const luaV_execute = function(L) {
}
case OCi.OP_BNOT: {
let op = L.stack[RB(L, base, i)];
- let numberop = tonumber(op);
if (op.ttisinteger()) {
L.stack[ra] = new lobject.TValue(CT.LUA_TNUMINT, ~op.value);