summaryrefslogtreecommitdiff
path: root/src/lstate.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-05-28 11:36:00 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-05-28 11:40:31 +0200
commit8173e639527cffc583c9c6ad6e7fc0d43429ab50 (patch)
tree0fc1cb51dbeb813f48fca03716088e0ecf61a989 /src/lstate.js
parentbaa9730a961ab2d1810a3093f63e2c66241a6b72 (diff)
parent183768f08070003691f206ac16cb2310a7b4fa90 (diff)
downloadfengari-8173e639527cffc583c9c6ad6e7fc0d43429ab50.tar.gz
fengari-8173e639527cffc583c9c6ad6e7fc0d43429ab50.tar.bz2
fengari-8173e639527cffc583c9c6ad6e7fc0d43429ab50.zip
Merge remote-tracking branch 'daurnimator/stack-modification-work' into test-suite
Diffstat (limited to 'src/lstate.js')
-rw-r--r--src/lstate.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lstate.js b/src/lstate.js
index 2413574..9046adf 100644
--- a/src/lstate.js
+++ b/src/lstate.js
@@ -109,8 +109,8 @@ const stack_init = function(L1, L) {
let ci = L1.base_ci;
ci.next = ci.previous = null;
ci.callstatus = 0;
- ci.func = L1.stack[L1.top];
ci.funcOff = L1.top;
+ ci.func = L1.stack[L1.top];
L1.stack[L1.top++] = new lobject.TValue(CT.LUA_TNIL, null);
ci.top = L1.top + defs.LUA_MINSTACK;
L1.ci = ci;
@@ -147,7 +147,8 @@ const f_luaopen = function(L) {
const lua_newthread = function(L) {
let g = L.l_G;
let L1 = new lua_State(g);
- L.stack[L.top++] = new lobject.TValue(CT.LUA_TTHREAD, L1);
+ L.stack[L.top] = new lobject.TValue(CT.LUA_TTHREAD, L1);
+ L.top++;
assert(L.top <= L.ci.top, "stack overflow");
L1.hookmask = L.hookmask;
L1.basehookcount = L.basehookcount;