diff options
| -rw-r--r-- | lapi.c | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lapi.c,v 2.168 2012/11/04 20:08:17 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.169 2012/12/05 19:09:23 roberto Exp roberto $ |
| 3 | ** Lua API | 3 | ** Lua API |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -196,7 +196,8 @@ LUA_API void lua_insert (lua_State *L, int idx) { | |||
| 196 | lua_lock(L); | 196 | lua_lock(L); |
| 197 | p = index2addr(L, idx); | 197 | p = index2addr(L, idx); |
| 198 | api_checkstackindex(L, idx, p); | 198 | api_checkstackindex(L, idx, p); |
| 199 | for (q = L->top; q>p; q--) setobjs2s(L, q, q-1); | 199 | for (q = L->top; q > p; q--) /* use L->top as a temporary */ |
| 200 | setobjs2s(L, q, q - 1); | ||
| 200 | setobjs2s(L, p, L->top); | 201 | setobjs2s(L, p, L->top); |
| 201 | lua_unlock(L); | 202 | lua_unlock(L); |
| 202 | } | 203 | } |
