Skip to content

Commit 8cd5832

Browse files
committed
Fix wrong write barrier on fields copy
Previously this write barrier was using the destination object as the new parent, rather than the fields object. Found by wbcheck
1 parent 3245356 commit 8cd5832

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

variable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2331,7 +2331,7 @@ rb_copy_generic_ivar(VALUE dest, VALUE obj)
23312331
new_fields_obj = rb_imemo_fields_new(rb_obj_class(dest), RSHAPE_CAPACITY(dest_shape_id));
23322332
VALUE *src_buf = rb_imemo_fields_ptr(fields_obj);
23332333
VALUE *dest_buf = rb_imemo_fields_ptr(new_fields_obj);
2334-
rb_shape_copy_fields(dest, dest_buf, dest_shape_id, obj, src_buf, src_shape_id);
2334+
rb_shape_copy_fields(new_fields_obj, dest_buf, dest_shape_id, obj, src_buf, src_shape_id);
23352335
RBASIC_SET_SHAPE_ID(new_fields_obj, dest_shape_id);
23362336

23372337
RB_VM_LOCKING() {

0 commit comments

Comments
 (0)