зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
437b8bc53b
Коммит
53f1de2f49
|
@ -1,3 +1,8 @@
|
|||
Tue Dec 3 20:18:46 2013 Narihiro Nakamura <authornari@gmail.com>
|
||||
|
||||
* 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 <glass.saga@gmail.com>
|
||||
|
||||
* array.c (rb_hash_rehash): use hash_alloc() instead of rb_hash_new().
|
||||
|
|
2
object.c
2
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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче