summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-26 17:06:55 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-27 22:43:25 +1000
commit183768f08070003691f206ac16cb2310a7b4fa90 (patch)
tree3031890676ebeec6635b33d80bddbdb299f41979
parent290704d7bd80907d7442f50b0bd56fdd2794107e (diff)
downloadfengari-183768f08070003691f206ac16cb2310a7b4fa90.tar.gz
fengari-183768f08070003691f206ac16cb2310a7b4fa90.tar.bz2
fengari-183768f08070003691f206ac16cb2310a7b4fa90.zip
src/lapi.js: Use a temporary variable in lua_len
-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");
};