summaryrefslogtreecommitdiff
path: root/src/lapi.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lapi.js')
-rw-r--r--src/lapi.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lapi.js b/src/lapi.js
index a8e0c82..e323e4f 100644
--- a/src/lapi.js
+++ b/src/lapi.js
@@ -1060,8 +1060,9 @@ const lua_concat = function(L, n) {
const lua_len = function(L, idx) {
let t = index2addr(L, idx);
- L.stack[L.top] = new TValue();
- lvm.luaV_objlen(L, L.stack[L.top], t);
+ let tv = new TValue();
+ lvm.luaV_objlen(L, tv, t);
+ L.stack[L.top] = tv;
L.top++;
assert(L.top <= L.ci.top, "stack overflow");
};