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