aboutsummaryrefslogtreecommitdiff
path: root/src/lj_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_api.c')
-rw-r--r--src/lj_api.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lj_api.c b/src/lj_api.c
index b9bac1d4..852c8c8b 100644
--- a/src/lj_api.c
+++ b/src/lj_api.c
@@ -121,9 +121,9 @@ LUA_API int lua_gettop(lua_State *L)
121LUA_API void lua_settop(lua_State *L, int idx) 121LUA_API void lua_settop(lua_State *L, int idx)
122{ 122{
123 if (idx >= 0) { 123 if (idx >= 0) {
124 api_check(L, idx <= L->maxstack - L->base); 124 api_check(L, idx <= tvref(L->maxstack) - L->base);
125 if (L->base + idx > L->top) { 125 if (L->base + idx > L->top) {
126 if (L->base + idx >= L->maxstack) 126 if (L->base + idx >= tvref(L->maxstack))
127 lj_state_growstack(L, (MSize)idx - (MSize)(L->top - L->base)); 127 lj_state_growstack(L, (MSize)idx - (MSize)(L->top - L->base));
128 do { setnilV(L->top++); } while (L->top < L->base + idx); 128 do { setnilV(L->top++); } while (L->top < L->base + idx);
129 } else { 129 } else {