From c09ab00b85677881f0ca0424b27ad14521e4a770 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 21 May 2017 19:01:49 +1000 Subject: src/lvm.js: integer unary minus need to be bitwise or-d --- src/lvm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lvm.js b/src/lvm.js index b00333a..6eea8f3 100644 --- a/src/lvm.js +++ b/src/lvm.js @@ -376,7 +376,7 @@ const luaV_execute = function(L) { let numberop = tonumber(op); if (op.ttisinteger()) { - L.stack[ra] = new lobject.TValue(CT.LUA_TNUMINT, -op.value); + L.stack[ra] = new lobject.TValue(CT.LUA_TNUMINT, (-op.value)|0); } else if (numberop !== false) { L.stack[ra] = new lobject.TValue(CT.LUA_TNUMFLT, -numberop); } else { -- cgit v1.2.3-70-g09d2