* object.c (rb_obj_clone): don't copy FL_WB_PROTECTED of a

original object.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nari 2013-12-03 14:14:09 +00:00
Родитель 218d1f5e1e
Коммит 7e1f3c636b
2 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Tue Dec 3 23:06:20 2013 Narihiro Nakamura <authornari@gmail.com>
* object.c (rb_obj_clone): don't copy FL_WB_PROTECTED of a
original object.
Tue Dec 3 22:32:18 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* hash.c (rb_hash_recursive): make similar (recursive) constructs

Просмотреть файл

@ -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);