aboutsummaryrefslogtreecommitdiffstats
path: root/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'class.c')
-rw-r--r--class.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/class.c b/class.c
index 364f258333..32ce4d3ec0 100644
--- a/class.c
+++ b/class.c
@@ -331,7 +331,6 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
rb_free_const_table(RCLASS_CONST_TBL(clone));
RCLASS_CONST_TBL(clone) = 0;
}
- RCLASS_M_TBL(clone) = 0;
if (RCLASS_IV_TBL(orig)) {
st_data_t id;
@@ -354,6 +353,7 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
struct clone_method_arg arg;
arg.old_klass = orig;
arg.new_klass = clone;
+ rb_id_table_free(RCLASS_M_TBL(clone));
RCLASS_M_TBL_INIT(clone);
rb_id_table_foreach(RCLASS_M_TBL(orig), clone_method_i, &arg);
}