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