| 220 | |
| 221 | |
| 222 | LUA_API void lua_copy (lua_State *L, int fromidx, int toidx) { |
| 223 | TValue *fr, *to; |
| 224 | lua_lock(L); |
| 225 | fr = index2addr(L, fromidx); |
| 226 | to = index2addr(L, toidx); |
| 227 | api_checkvalidindex(L, to); |
| 228 | setobj(L, to, fr); |
| 229 | if (isupvalue(toidx)) /* function upvalue? */ |
| 230 | luaC_barrier(L, clCvalue(L->ci->func), fr); |
| 231 | /* LUA_REGISTRYINDEX does not need gc barrier |
| 232 | (collector revisits it before finishing collection) */ |
| 233 | lua_unlock(L); |
| 234 | } |
| 235 | |
| 236 | |
| 237 | LUA_API void lua_pushvalue (lua_State *L, int idx) { |
no test coverage detected