summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2025-05-22 11:21:11 +0200
committerJean Boussier <[email protected]>2025-05-22 12:10:10 +0200
commitf18883b2954ef327eef59dec356391c2541e5dcd (patch)
treee96fb10a7607cdb6c89445e7c980ad3424ea4947 /class.c
parentec41b1e8231ed9fff207f273d65d7c357151b1d6 (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13409
Diffstat (limited to 'class.c')
-rw-r--r--class.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/class.c b/class.c
index 3c81132ce3..d743fb3fbb 100644
--- a/class.c
+++ b/class.c
@@ -278,10 +278,12 @@ class_duplicate_iclass_classext(VALUE iclass, rb_classext_t *mod_ext, const rb_n
else {
RCLASSEXT_M_TBL(ext) = RCLASSEXT_M_TBL(mod_ext);
}
- RCLASSEXT_FIELDS(ext) = (VALUE *)st_init_numtable();
+
RCLASSEXT_CONST_TBL(ext) = RCLASSEXT_CONST_TBL(mod_ext);
RCLASSEXT_CVC_TBL(ext) = RCLASSEXT_CVC_TBL(mod_ext);
+ RUBY_ASSERT(!RCLASSEXT_FIELDS(mod_ext));
+
// Those are cache and should be recreated when methods are called
// RCLASSEXT_CALLABLE_M_TBL(ext) = NULL;
// RCLASSEXT_CC_TBL(ext) = NULL;