Skip to content

Commit 5e5ccdb

Browse files
committed
WIP
1 parent e76c9c1 commit 5e5ccdb

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

gc.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1912,16 +1912,12 @@ object_id_to_ref(void *objspace_ptr, VALUE object_id)
19121912
static inline void
19131913
obj_free_object_id(VALUE obj)
19141914
{
1915-
if (FL_TEST_RAW(obj, RUBY_FL_UNUSED9)) {
1916-
rb_bug("already freed that object_id %s", rb_obj_info(obj));
1917-
}
1918-
else {
1919-
FL_SET_RAW(obj, RUBY_FL_UNUSED9);
1920-
}
1921-
19221915
if (RB_UNLIKELY(id_to_obj_tbl)) {
19231916
if (rb_shape_obj_has_id(obj)) {
19241917
VALUE obj_id = rb_obj_id(obj);
1918+
if (!FIXNUM_P(obj_id)) {
1919+
rb_bug("Corrupted object_id=%s obj=%s", rb_obj_info(obj_id), rb_obj_info(obj));
1920+
}
19251921
st_data_t id = (st_data_t)obj_id;
19261922
GC_ASSERT(id);
19271923

@@ -1935,6 +1931,13 @@ obj_free_object_id(VALUE obj)
19351931
void
19361932
rb_gc_obj_free_vm_weak_references(VALUE obj)
19371933
{
1934+
if (FL_TEST_RAW(obj, RUBY_FL_UNUSED9)) {
1935+
rb_bug("already freed that object %s", rb_obj_info(obj));
1936+
}
1937+
else {
1938+
FL_SET_RAW(obj, RUBY_FL_UNUSED9);
1939+
}
1940+
19381941
obj_free_object_id(obj);
19391942

19401943
if (FL_TEST(obj, FL_EXIVAR)) {

0 commit comments

Comments
 (0)