Skip to content

Commit 75e4a82

Browse files
committed
Fix object ID in rb_gc_impl_define_finalizer
The 0th element of the finalizer table array should be the object ID.
1 parent e007176 commit 75e4a82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gc/mmtk/mmtk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ rb_gc_impl_define_finalizer(void *objspace_ptr, VALUE obj, VALUE block)
946946
rb_ary_push(table, block);
947947
}
948948
else {
949-
table = rb_ary_new3(2, block);
949+
table = rb_ary_new3(2, rb_obj_id(obj), block);
950950
rb_obj_hide(table);
951951
st_add_direct(objspace->finalizer_table, obj, table);
952952
}

0 commit comments

Comments
 (0)