diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-07-09 08:07:26 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-07-09 08:07:26 +0000 |
commit | 38e05ff3e194268fd2f38ac7c9530298e464f07b (patch) | |
tree | 916a946c3b007aab49039846a62fd5978c4af776 /object.c | |
parent | 63efc86bf745b041f228235cdda62b2d4ceeba4e (diff) |
Don't copy FL_USER* on Kernel#clone. [Bug #14847]
* object.c (mutable_obj_clone): `Kernel#clone` should not copy
FL_USER* flags because they are copied unexpectedly.
Unexpected copy will break internal data consistency.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 2 |
1 files changed, 0 insertions, 2 deletions
@@ -448,8 +448,6 @@ mutable_obj_clone(VALUE obj, int kwfreeze) VALUE clone, singleton; clone = rb_obj_alloc(rb_obj_class(obj)); - RBASIC(clone)->flags &= (FL_TAINT|FL_PROMOTED0|FL_PROMOTED1); - RBASIC(clone)->flags |= RBASIC(obj)->flags & ~(FL_PROMOTED0|FL_PROMOTED1|FL_FREEZE|FL_FINALIZE); singleton = rb_singleton_class_clone_and_attach(obj, clone); RBASIC_SET_CLASS(clone, singleton); |