diff options
| author | Peter Zhu <peter@peterzhu.ca> | 2025-10-16 17:11:30 -0400 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2025-10-17 17:26:00 -0400 |
| commit | cb55043383cbf39ac1df1d227836080a3d7cef33 (patch) | |
| tree | eca8a349b469a13e534a782fa067522f2d197fe2 /class.c | |
| parent | 1c119f02456ff7dd3a4025456f8de5e50be88ef3 (diff) | |
Set method table owned by iclass in rb_class_duplicate_classext
We duplicate the method table in rb_class_duplicate_classext, so we should
set RCLASSEXT_ICLASS_IS_ORIGIN and unset RCLASSEXT_ICLASS_ORIGIN_SHARED_MTBL
to signal that the iclass owns the method table and it should be freed.
Diffstat (limited to 'class.c')
| -rw-r--r-- | class.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -305,6 +305,8 @@ rb_class_duplicate_classext(rb_classext_t *orig, VALUE klass, const rb_namespace RCLASSEXT_SUPER(ext) = RCLASSEXT_SUPER(orig); RCLASSEXT_M_TBL(ext) = duplicate_classext_m_tbl(RCLASSEXT_M_TBL(orig), klass, dup_iclass); + RCLASSEXT_ICLASS_IS_ORIGIN(ext) = true; + RCLASSEXT_ICLASS_ORIGIN_SHARED_MTBL(ext) = false; if (orig->fields_obj) { RB_OBJ_WRITE(klass, &ext->fields_obj, rb_imemo_fields_clone(orig->fields_obj)); |
