From 183768f08070003691f206ac16cb2310a7b4fa90 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Fri, 26 May 2017 17:06:55 +1000 Subject: src/lapi.js: Use a temporary variable in lua_len --- src/lapi.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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"); }; -- cgit v1.2.3-70-g09d2