| 253 | |
| 254 | |
| 255 | LUA_API void lua_copy (lua_State *L, int fromidx, int toidx) { |
| 256 | TValue *fr, *to; |
| 257 | lua_lock(L); |
| 258 | fr = index2value(L, fromidx); |
| 259 | to = index2value(L, toidx); |
| 260 | api_check(L, isvalid(L, to), "invalid index"); |
| 261 | setobj(L, to, fr); |
| 262 | if (isupvalue(toidx)) /* function upvalue? */ |
| 263 | luaC_barrier(L, clCvalue(s2v(L->ci->func.p)), fr); |
| 264 | /* LUA_REGISTRYINDEX does not need gc barrier |
| 265 | (collector revisits it before finishing collection) */ |
| 266 | lua_unlock(L); |
| 267 | } |
| 268 | |
| 269 | |
| 270 | LUA_API void lua_pushvalue (lua_State *L, int idx) { |
no test coverage detected