object.c: test bits at once
* object.c (rb_obj_clone): test TAINT and UNTRUSTED bits at once. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4d73f95068
commit
d4736bcf4d
3
object.c
3
object.c
@ -296,7 +296,8 @@ rb_obj_clone(VALUE obj)
|
|||||||
if (FL_TEST(singleton, FL_SINGLETON)) {
|
if (FL_TEST(singleton, FL_SINGLETON)) {
|
||||||
rb_singleton_class_attached(singleton, clone);
|
rb_singleton_class_attached(singleton, clone);
|
||||||
}
|
}
|
||||||
RBASIC(clone)->flags = (RBASIC(obj)->flags | FL_TEST(clone, FL_TAINT) | FL_TEST(clone, FL_UNTRUSTED)) & ~(FL_FREEZE|FL_FINALIZE);
|
RBASIC(clone)->flags &= (FL_TAINT|FL_UNTRUSTED);
|
||||||
|
RBASIC(clone)->flags |= RBASIC(obj)->flags & ~(FL_FREEZE|FL_FINALIZE);
|
||||||
init_copy(clone, obj);
|
init_copy(clone, obj);
|
||||||
rb_funcall(clone, id_init_clone, 1, obj);
|
rb_funcall(clone, id_init_clone, 1, obj);
|
||||||
RBASIC(clone)->flags |= RBASIC(obj)->flags & FL_FREEZE;
|
RBASIC(clone)->flags |= RBASIC(obj)->flags & FL_FREEZE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user