зеркало из https://github.com/github/ruby.git
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:
Родитель
4d73f95068
Коммит
d4736bcf4d
3
object.c
3
object.c
|
@ -296,7 +296,8 @@ rb_obj_clone(VALUE obj)
|
|||
if (FL_TEST(singleton, FL_SINGLETON)) {
|
||||
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);
|
||||
rb_funcall(clone, id_init_clone, 1, obj);
|
||||
RBASIC(clone)->flags |= RBASIC(obj)->flags & FL_FREEZE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче