summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'object.c')
-rw-r--r--object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/object.c b/object.c
index 8c85e0d657..660be571ab 100644
--- a/object.c
+++ b/object.c
@@ -298,7 +298,7 @@ rb_obj_clone(VALUE obj)
rb_raise(rb_eTypeError, "can't clone %s", rb_obj_classname(obj));
}
clone = rb_obj_alloc(rb_obj_class(obj));
- singleton = rb_singleton_class_clone(obj);
+ singleton = rb_singleton_class_clone_and_attach(obj, clone);
RBASIC(clone)->klass = singleton;
if (FL_TEST(singleton, FL_SINGLETON)) {
rb_singleton_class_attached(singleton, clone);