julia
e0923156 - Fix jl_gc_wb_genericmemory_copy_boxed not advancing src/dest ptr (#61852)

Commit
2 days ago
Fix jl_gc_wb_genericmemory_copy_boxed not advancing src/dest ptr (#61852) Claude Opus 4.7 xhigh spotted this one when I was making some unrelated changes (I'm impressed!). #57252/378a42508d4 introduced this bug when extracting the code for `jl_gc_wb_genericmemory_copy_boxed` from `jl_genericmemory_copyto`: the caller assumes `src_p` and `dest_p` will be updated to point to the remaining elements `memmove_refs` must copy, but we no longer mutate them. I had Claude turn them into pointers, so they are updated like before. Nifty PoC: ```julia dest = Any[nothing for i=1:16] for i in 1:2 GC.gc(true) GC.gc(false) end src = vcat(Any[nothing], Any[Ref(100 * i) for i=1:15]) copyto!(dest, src) for (i, (x, y)) in enumerate(zip(dest, src)) if x !== y println("dest[$i] = $x, expected src[$i] = $y") end end ```
Author
Parents
Loading