aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-23 17:38:15 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-27 22:14:37 +1000
commit941e38fe2360fc0b4fa6f4ef5c9a9a43c172d528 (patch)
treea2d786bcb1c768dea3f7424a80cbb265770c8698
parent888c1286cfe25c1b21605c3443cc0a20b522972b (diff)
downloadfengari-941e38fe2360fc0b4fa6f4ef5c9a9a43c172d528.tar.gz
fengari-941e38fe2360fc0b4fa6f4ef5c9a9a43c172d528.tar.bz2
fengari-941e38fe2360fc0b4fa6f4ef5c9a9a43c172d528.zip
src/lvm.js: Use setobjs2s in luaV_finishOp's OP_CONCAT case
-rw-r--r--src/lvm.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lvm.js b/src/lvm.js
index c7bb7ad..ecacd92 100644
--- a/src/lvm.js
+++ b/src/lvm.js
@@ -54,14 +54,13 @@ const luaV_finishOp = function(L) {
let top = L.top - 1; /* top when 'luaT_trybinTM' was called */
let b = inst.B; /* first element to concatenate */
let total = top - 1 - (base + b); /* yet to concatenate */
- L.stack[top - 2] = L.stack[top]; /* put TM result in proper position */
+ lobject.setobjs2s(L, top - 2, top); /* put TM result in proper position */
if (total > 1) { /* are there elements to concat? */
L.top = top - 1; /* top is one after last element (at top-2) */
luaV_concat(L, total); /* concat them (may yield again) */
}
-
/* move final result to final position */
- L.stack[ci.l_base + inst.A] = L.stack[L.top - 1];
+ lobject.setobjs2s(L, ci.l_base + inst.A, L.top - 1);
L.top = ci.top; /* restore top */
break;
}