summaryrefslogtreecommitdiff
path: root/src/ldebug.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-12 12:35:27 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-12 12:35:27 +1000
commited045635968039ea22c35515c270ee4b442dd4ab (patch)
tree8229633c09788af7b7d8f42a070d3e161e026c90 /src/ldebug.js
parent195db4ee20fb6b593e9b52a8d671ff088da26336 (diff)
downloadfengari-ed045635968039ea22c35515c270ee4b442dd4ab.tar.gz
fengari-ed045635968039ea22c35515c270ee4b442dd4ab.tar.bz2
fengari-ed045635968039ea22c35515c270ee4b442dd4ab.zip
src/ldebug.js: Don't modify TValues on stack
Diffstat (limited to 'src/ldebug.js')
-rw-r--r--src/ldebug.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/ldebug.js b/src/ldebug.js
index e0e2366..7de5cdc 100644
--- a/src/ldebug.js
+++ b/src/ldebug.js
@@ -152,9 +152,8 @@ const lua_setlocal = function(L, ar, n) {
let name = local.name;
let pos = local.pos;
if (name) {
- L.stack[pos].type = L.stack[L.top - 1].type;
- L.stack[pos].value = L.stack[L.top - 1].value;
- L.top--; /* pop value */
+ L.stack[pos] = L.stack[L.top - 1];
+ delete L.stack[--L.top]; /* pop value */
}
swapextra(L);
return name;