| 163 | |
| 164 | |
| 165 | LUA_API void lua_settop (lua_State *L, int idx) { |
| 166 | StkId func = L->ci->func; |
| 167 | lua_lock(L); |
| 168 | if (idx >= 0) { |
| 169 | api_check(L, idx <= L->stack_last - (func + 1), "new top too large"); |
| 170 | while (L->top < (func + 1) + idx) |
| 171 | setnilvalue(L->top++); |
| 172 | L->top = (func + 1) + idx; |
| 173 | } |
| 174 | else { |
| 175 | api_check(L, -(idx+1) <= (L->top - (func + 1)), "invalid new top"); |
| 176 | L->top += idx+1; /* `subtract' index (index is negative) */ |
| 177 | } |
| 178 | lua_unlock(L); |
| 179 | } |
| 180 | |
| 181 | |
| 182 | LUA_API void lua_remove (lua_State *L, int idx) { |
no outgoing calls
no test coverage detected