summaryrefslogtreecommitdiff
path: root/src/ldebug.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/ldebug.js')
-rw-r--r--src/ldebug.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ldebug.js b/src/ldebug.js
index 0231e67..e78d3e7 100644
--- a/src/ldebug.js
+++ b/src/ldebug.js
@@ -140,7 +140,9 @@ const lua_getlocal = function(L, ar, n) {
let local = findlocal(L, ar.i_ci, n);
if (local) {
name = local.name;
- L.stack[L.top++] = L.stack[local.pos];
+ lobject.setobj2s(L, L.top, L.stack[local.pos]);
+ L.top++;
+ assert(L.top <= L.ci.top, "stack overflow");
} else {
name = null;
}