diff --git a/ChangeLog b/ChangeLog index b8a2526872..76013df34f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Dec 3 23:06:20 2013 Narihiro Nakamura + + * object.c (rb_obj_clone): don't copy FL_WB_PROTECTED of a + original object. + Tue Dec 3 22:32:18 2013 Nobuyoshi Nakada * hash.c (rb_hash_recursive): make similar (recursive) constructs diff --git a/object.c b/object.c index f316a1bcbe..87e9608e76 100644 --- a/object.c +++ b/object.c @@ -336,7 +336,7 @@ rb_obj_clone(VALUE obj) } clone = rb_obj_alloc(rb_obj_class(obj)); RBASIC(clone)->flags &= (FL_TAINT|FL_PROMOTED|FL_WB_PROTECTED); - RBASIC(clone)->flags |= RBASIC(obj)->flags & ~(FL_PROMOTED|FL_FREEZE|FL_FINALIZE); + RBASIC(clone)->flags |= RBASIC(obj)->flags & ~(FL_PROMOTED|FL_FREEZE|FL_FINALIZE|FL_WB_PROTECTED); singleton = rb_singleton_class_clone_and_attach(obj, clone); RBASIC_SET_CLASS(clone, singleton);