diff options
author | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-03 11:24:11 +0000 |
---|---|---|
committer | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-03 11:24:11 +0000 |
commit | 53f1de2f49cafeba1f1c7f0674c976f3c0bb4be0 (patch) | |
tree | 38727568ac093c745b720e1bfe96f314c1b74b64 | |
parent | 437b8bc53b25c3c2ac751db816dc1076d8c6957f (diff) | |
download | ruby-53f1de2f49cafeba1f1c7f0674c976f3c0bb4be0.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | object.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -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(). @@ -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); |