From 53f1de2f49cafeba1f1c7f0674c976f3c0bb4be0 Mon Sep 17 00:00:00 2001 From: nari Date: Tue, 3 Dec 2013 11:24:11 +0000 Subject: [PATCH] * object.c (rb_obj_clone): Protect FL_PROMOTED and FL_WB_PROTECTED flags of a destination object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ object.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 496159baea..6f93547ceb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Dec 3 20:18:46 2013 Narihiro Nakamura + + * object.c (rb_obj_clone): Protect FL_PROMOTED and FL_WB_PROTECTED + flags of a destination object. + Tue Dec 3 20:16:38 2013 Masaki Matsushita * array.c (rb_hash_rehash): use hash_alloc() instead of rb_hash_new(). diff --git a/object.c b/object.c index 70f6d66e5e..f316a1bcbe 100644 --- a/object.c +++ b/object.c @@ -335,7 +335,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_PROMOTED|FL_WB_PROTECTED); RBASIC(clone)->flags |= RBASIC(obj)->flags & ~(FL_PROMOTED|FL_FREEZE|FL_FINALIZE); singleton = rb_singleton_class_clone_and_attach(obj, clone);