Skip to content

Commit 2c6e16e

Browse files
committed
Don't assume st_data_t and VALUE are the same in rb_gc_impl_object_id
1 parent de28ef7 commit 2c6e16e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gc/default.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1683,8 +1683,10 @@ rb_gc_impl_object_id(void *objspace_ptr, VALUE obj)
16831683
rb_objspace_t *objspace = objspace_ptr;
16841684

16851685
unsigned int lev = rb_gc_vm_lock();
1686-
if (st_lookup(objspace->obj_to_id_tbl, (st_data_t)obj, &id)) {
1686+
st_data_t val;
1687+
if (st_lookup(objspace->obj_to_id_tbl, (st_data_t)obj, &val)) {
16871688
GC_ASSERT(FL_TEST(obj, FL_SEEN_OBJ_ID));
1689+
id = (VALUE)val;
16881690
}
16891691
else {
16901692
GC_ASSERT(!FL_TEST(obj, FL_SEEN_OBJ_ID));

0 commit comments

Comments
 (0)