Skip to content

Commit e7ba6bd

Browse files
committed
Namespaces: Don't initialize fields for T_ICLASS
ICLASS don't have instance variables or anything like that. `gc_mark_classext_iclass` didn't mark it, and `classext_iclass_free` wasn't freeing it.
1 parent ec41b1e commit e7ba6bd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

class.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,12 @@ class_duplicate_iclass_classext(VALUE iclass, rb_classext_t *mod_ext, const rb_n
278278
else {
279279
RCLASSEXT_M_TBL(ext) = RCLASSEXT_M_TBL(mod_ext);
280280
}
281-
RCLASSEXT_FIELDS(ext) = (VALUE *)st_init_numtable();
281+
282282
RCLASSEXT_CONST_TBL(ext) = RCLASSEXT_CONST_TBL(mod_ext);
283283
RCLASSEXT_CVC_TBL(ext) = RCLASSEXT_CVC_TBL(mod_ext);
284284

285+
RUBY_ASSERT(!RCLASSEXT_FIELDS(mod_ext));
286+
285287
// Those are cache and should be recreated when methods are called
286288
// RCLASSEXT_CALLABLE_M_TBL(ext) = NULL;
287289
// RCLASSEXT_CC_TBL(ext) = NULL;

0 commit comments

Comments
 (0)