Skip to content

Commit b8edf3a

Browse files
byroothsbt
authored andcommitted
rb_gc_impl_copy_finalizer: generate a new object id
Fix a regression introduced by: ruby/ruby#13155
1 parent ec8db24 commit b8edf3a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

gc/mmtk/mmtk.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,8 @@ rb_gc_impl_copy_finalizer(void *objspace_ptr, VALUE dest, VALUE obj)
985985

986986
int lev = rb_gc_vm_lock();
987987
if (RB_LIKELY(st_lookup(objspace->finalizer_table, obj, &data))) {
988-
table = (VALUE)data;
988+
table = rb_ary_dup((VALUE)data);
989+
RARRAY_ASET(table, 0, rb_obj_id(dest));
989990
st_insert(objspace->finalizer_table, dest, table);
990991
FL_SET(dest, FL_FINALIZE);
991992
}

0 commit comments

Comments
 (0)