summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'class.c')
-rw-r--r--class.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/class.c b/class.c
index 243f8c4610..08c0a191e1 100644
--- a/class.c
+++ b/class.c
@@ -308,11 +308,17 @@ class_init_copy_check(VALUE clone, VALUE orig)
rb_raise(rb_eTypeError, "can't copy singleton class");
}
}
-
+#include "gc.h"
/* :nodoc: */
VALUE
rb_mod_init_copy(VALUE clone, VALUE orig)
{
+ /* cloned flag is refer at constant inline cache
+ * see vm_get_const_key_cref() in vm_insnhelper.c
+ */
+ FL_SET(clone, RCLASS_CLONED);
+ FL_SET(orig , RCLASS_CLONED);
+
if (RB_TYPE_P(clone, T_CLASS)) {
class_init_copy_check(clone, orig);
}