summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-18 21:31:55 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-18 21:31:55 +0000
commit6964df9a21633be9c77eba96e56f8a62db8901d1 (patch)
treeba4bfc3d4a3f5646b9dba070b849f71f11acb05d /object.c
parent5f879f76d7e7a546fcf3ecb67de8d3cbe475b6c4 (diff)
* object.c (rb_obj_clone): do not touch age (FL_PROMOTED[01]) because
rb_obj_alloc() can return old object in debug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 5c8bf62..79358ad 100644
--- a/object.c
+++ b/object.c
@@ -328,7 +328,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));
- RBASIC(clone)->flags &= (FL_TAINT);
+ RBASIC(clone)->flags &= (FL_TAINT|FL_PROMOTED0|FL_PROMOTED1);
RBASIC(clone)->flags |= RBASIC(obj)->flags & ~(FL_PROMOTED0|FL_PROMOTED1|FL_FREEZE|FL_FINALIZE);
singleton = rb_singleton_class_clone_and_attach(obj, clone);