summaryrefslogtreecommitdiff
path: root/src/lobject.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lobject.js')
-rw-r--r--src/lobject.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lobject.js b/src/lobject.js
index f395036..7f81438 100644
--- a/src/lobject.js
+++ b/src/lobject.js
@@ -658,7 +658,9 @@ const numarith = function(L, op, v1, v2) {
}
};
-const luaO_arith = function(L, op, p1, p2, res) {
+const luaO_arith = function(L, op, p1, p2, p3) {
+ let res = (typeof p3 === "number") ? L.stack[p3] : p3; /* FIXME */
+
switch (op) {
case defs.LUA_OPBAND: case defs.LUA_OPBOR: case defs.LUA_OPBXOR:
case defs.LUA_OPSHL: case defs.LUA_OPSHR:
@@ -693,7 +695,7 @@ const luaO_arith = function(L, op, p1, p2, res) {
}
/* could not perform raw operation; try metamethod */
assert(L !== null); /* should not fail when folding (compile time) */
- ltm.luaT_trybinTM(L, p1, p2, res, (op - defs.LUA_OPADD) + ltm.TMS.TM_ADD);
+ ltm.luaT_trybinTM(L, p1, p2, p3, (op - defs.LUA_OPADD) + ltm.TMS.TM_ADD);
};