summaryrefslogtreecommitdiff
path: root/src/lstate.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lstate.js')
-rw-r--r--src/lstate.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lstate.js b/src/lstate.js
index 2413574..b7a11bc 100644
--- a/src/lstate.js
+++ b/src/lstate.js
@@ -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;