summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-23 18:01:46 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-23 18:01:46 +0000
commitb8b26d05cef49eb671ba5b69895d8987a6275c3a (patch)
tree74fb5cc86384a29442ea193df9cd593e1d4cc8e5 /object.c
parent28eb5913956bced2429cb5362ed6d6bb28ebb350 (diff)
downloadruby-b8b26d05cef49eb671ba5b69895d8987a6275c3a.tar.gz
* object.c (rb_obj_clone): should not propagate OLDGEN status.
This propagation had caused WB miss for class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/object.c b/object.c
index bcf021dc95..be53703ae3 100644
--- a/object.c
+++ b/object.c
@@ -335,13 +335,15 @@ 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));
+ RBASIC(clone)->flags &= (FL_TAINT|FL_UNTRUSTED);
+ RBASIC(clone)->flags |= RBASIC(obj)->flags & ~(FL_OLDGEN|FL_FREEZE|FL_FINALIZE);
+
singleton = rb_singleton_class_clone_and_attach(obj, clone);
RBASIC_SET_CLASS(clone, singleton);
if (FL_TEST(singleton, FL_SINGLETON)) {
rb_singleton_class_attached(singleton, clone);
}
- RBASIC(clone)->flags &= (FL_TAINT|FL_UNTRUSTED);
- RBASIC(clone)->flags |= RBASIC(obj)->flags & ~(FL_FREEZE|FL_FINALIZE);
+
init_copy(clone, obj);
rb_funcall(clone, id_init_clone, 1, obj);
RBASIC(clone)->flags |= RBASIC(obj)->flags & FL_FREEZE;