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