| 226 | |
| 227 | |
| 228 | LUA_API void lua_copy (lua_State *L, int fromidx, int toidx) { |
| 229 | TValue *fr, *to; |
| 230 | lua_lock(L); |
| 231 | fr = index2value(L, fromidx); |
| 232 | to = index2value(L, toidx); |
| 233 | api_check(L, isvalid(L, to), "invalid index"); |
| 234 | setobj(L, to, fr); |
| 235 | if (isupvalue(toidx)) /* function upvalue? */ |
| 236 | luaC_barrier(L, clCvalue(s2v(L->ci->func)), fr); |
| 237 | /* LUA_REGISTRYINDEX does not need gc barrier |
| 238 | (collector revisits it before finishing collection) */ |
| 239 | lua_unlock(L); |
| 240 | } |
| 241 | |
| 242 | |
| 243 | LUA_API void lua_pushvalue (lua_State *L, int idx) { |
no test coverage detected