From 941e38fe2360fc0b4fa6f4ef5c9a9a43c172d528 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Tue, 23 May 2017 17:38:15 +1000 Subject: src/lvm.js: Use setobjs2s in luaV_finishOp's OP_CONCAT case --- src/lvm.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3-70-g09d2