aboutsummaryrefslogtreecommitdiff
path: root/src/ldebug.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-23 17:37:20 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-27 22:14:35 +1000
commit888c1286cfe25c1b21605c3443cc0a20b522972b (patch)
tree803c8a31cccbb5013539fd0a575cc10f6af5a7fb /src/ldebug.js
parentb3c87776e08f546a9994527f7c2c7fc4ec07d9a1 (diff)
downloadfengari-888c1286cfe25c1b21605c3443cc0a20b522972b.tar.gz
fengari-888c1286cfe25c1b21605c3443cc0a20b522972b.tar.bz2
fengari-888c1286cfe25c1b21605c3443cc0a20b522972b.zip
Introduce setobj2s
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;
}