From 018f9cd8bbff126b7381bafa135e8127033c2faa Mon Sep 17 00:00:00 2001 From: daurnimator Date: Wed, 24 May 2017 14:14:58 +1000 Subject: Keep api_incr_top macro contents distinct - Don't have postincrement in a previous expression - Fix a couple of places the assert was missing --- src/lstate.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lstate.js') 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; -- cgit v1.2.3-54-g00ecf