Fix missed write barrier on Ractor send move

When moving a "generic IV" object, we need a write barrier to the fields
object.

   WBCHECK ERROR: Missed write barrier detected!
     Parent object: 0x7c913641d1a0 (wb_protected: true)
       rb_obj_info_dump: 0x00007c913641d1a0 T_ARRAY/Array [E ] len: 10 (embed)
     Reference counts - snapshot: 1, writebarrier: 0, current: 2, missed: 1
     Missing reference to: 0x7bf1364e56d0
       rb_obj_info_dump: 0x00007bf1364e56d0 T_IMEMO/<fields>
This commit is contained in:
John Hawthorn 2025-06-30 16:28:49 -07:00
parent 5f1ca8ffbe
commit 32453560de

View file

@ -2355,6 +2355,7 @@ rb_replace_generic_ivar(VALUE clone, VALUE obj)
st_data_t fields_tbl, obj_data = (st_data_t)obj;
if (st_delete(generic_fields_tbl_, &obj_data, &fields_tbl)) {
st_insert(generic_fields_tbl_, (st_data_t)clone, fields_tbl);
RB_OBJ_WRITTEN(clone, Qundef, fields_tbl);
}
else {
rb_bug("unreachable");