From ed045635968039ea22c35515c270ee4b442dd4ab Mon Sep 17 00:00:00 2001 From: daurnimator Date: Fri, 12 May 2017 12:35:27 +1000 Subject: src/ldebug.js: Don't modify TValues on stack --- src/ldebug.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') 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; -- cgit v1.2.3-70-g09d2