diff options
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -104,7 +104,9 @@ LUA_API void lua_settop (lua_State *L, int index) { | |||
104 | lua_lock(L); | 104 | lua_lock(L); |
105 | if (index >= 0) { | 105 | if (index >= 0) { |
106 | api_check(L, index <= L->stack_last - L->ci->base); | 106 | api_check(L, index <= L->stack_last - L->ci->base); |
107 | luaD_adjusttop(L, L->ci->base+index); | 107 | while (L->top < L->ci->base + index) |
108 | setnilvalue(L->top++); | ||
109 | L->top = L->ci->base + index; | ||
108 | } | 110 | } |
109 | else { | 111 | else { |
110 | api_check(L, -(index+1) <= (L->top - L->ci->base)); | 112 | api_check(L, -(index+1) <= (L->top - L->ci->base)); |