diff options
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.44 2005/07/05 14:30:31 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.45 2005/07/06 18:07:30 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 | */ |
@@ -113,11 +113,11 @@ LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) { | |||
113 | if (from == to) return; | 113 | if (from == to) return; |
114 | lua_lock(to); | 114 | lua_lock(to); |
115 | api_checknelems(from, n); | 115 | api_checknelems(from, n); |
116 | api_check(L, G(from) == G(to)); | 116 | api_check(from, G(from) == G(to)); |
117 | api_check(from, to->ci->top - to->top >= n); | ||
117 | from->top -= n; | 118 | from->top -= n; |
118 | for (i = 0; i < n; i++) { | 119 | for (i = 0; i < n; i++) { |
119 | setobj2s(to, to->top, from->top + i); | 120 | setobj2s(to, to->top++, from->top + i); |
120 | api_incr_top(to); | ||
121 | } | 121 | } |
122 | lua_unlock(to); | 122 | lua_unlock(to); |
123 | } | 123 | } |
@@ -975,9 +975,9 @@ LUA_API int lua_next (lua_State *L, int idx) { | |||
975 | 975 | ||
976 | LUA_API void lua_concat (lua_State *L, int n) { | 976 | LUA_API void lua_concat (lua_State *L, int n) { |
977 | lua_lock(L); | 977 | lua_lock(L); |
978 | luaC_checkGC(L); | ||
979 | api_checknelems(L, n); | 978 | api_checknelems(L, n); |
980 | if (n >= 2) { | 979 | if (n >= 2) { |
980 | luaC_checkGC(L); | ||
981 | luaV_concat(L, n, cast(int, L->top - L->base) - 1); | 981 | luaV_concat(L, n, cast(int, L->top - L->base) - 1); |
982 | L->top -= (n-1); | 982 | L->top -= (n-1); |
983 | } | 983 | } |