diff options
author | Peter Zhu <peter@peterzhu.ca> | 2023-09-05 09:27:11 -0400 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2023-09-05 09:27:11 -0400 |
commit | ef65183692789f80dc1c1ad569a449edfdd46120 (patch) | |
tree | 84b88887c44441e112dc51ed9f007051969a208e /gc.c | |
parent | 5b157997e29ee41dd9c94861dde38d148bca941d (diff) |
Add check for T_NONE in rb_gc_mark_weak
This commit adds a check for T_NONE in rb_gc_mark_weak, just like
gc_mark_ptr. This will help debugging.
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -6903,6 +6903,11 @@ rb_gc_mark_weak(VALUE *ptr) GC_ASSERT(objspace->rgengc.parent_object == 0 || FL_TEST(objspace->rgengc.parent_object, FL_WB_PROTECTED)); + if (UNLIKELY(RB_TYPE_P(obj, T_NONE))) { + rp(obj); + rb_bug("try to mark T_NONE object"); + } + /* If we are in a minor GC and the other object is old, then obj should * already be marked and cannot be reclaimed in this GC cycle so we don't * need to add it to the weak refences list. */ |