Commit c7c0483
ractor.c: preserve aliasing during Ractor move
Moving an unshareable object graph with duplicate references failed to
preserve aliasing because the traversal checked the `rec` table too late.
On a move path, `move_leave` replaces the original object with a
`Ractor::MovedObject` tombstone. Because `move_enter` classifies this
tombstone as shareable, the second visit returned `traverse_skip` before
the visited `rec` lookup was reached.
Fix this by performing the `st_lookup` on `data->rec` at the top of
`obj_traverse_replace_i`, before calling `enter_func`. We guard the lookup
with a NULL check on `data->rec` to avoid allocating `rec_hash` for
simple graphs.1 parent faa3cc8 commit c7c0483
2 files changed
Lines changed: 31 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
659 | 682 | | |
660 | 683 | | |
661 | 684 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1841 | 1841 | | |
1842 | 1842 | | |
1843 | 1843 | | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
1844 | 1849 | | |
1845 | 1850 | | |
1846 | 1851 | | |
1847 | 1852 | | |
1848 | 1853 | | |
1849 | 1854 | | |
1850 | 1855 | | |
1851 | | - | |
1852 | | - | |
1853 | | - | |
1854 | | - | |
1855 | | - | |
1856 | | - | |
1857 | | - | |
1858 | | - | |
1859 | | - | |
1860 | | - | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
1861 | 1859 | | |
1862 | 1860 | | |
1863 | 1861 | | |
| |||
0 commit comments