* object.c (rb_obj_clone): should not propagate OLDGEN status.

This propagation had caused WB miss for class.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2013-05-23 18:01:46 +00:00
Родитель 28eb591395
Коммит b8b26d05ce
2 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Fri May 24 02:57:17 2013 Koichi Sasada <ko1@atdot.net>
* object.c (rb_obj_clone): should not propagate OLDGEN status.
This propagation had caused WB miss for class.
Thu May 23 17:35:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* load.c (loaded_feature_path): fix invalid read by index underflow.

Просмотреть файл

@ -335,13 +335,15 @@ 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|FL_UNTRUSTED);
RBASIC(clone)->flags |= RBASIC(obj)->flags & ~(FL_OLDGEN|FL_FREEZE|FL_FINALIZE);
singleton = rb_singleton_class_clone_and_attach(obj, clone);
RBASIC_SET_CLASS(clone, singleton);
if (FL_TEST(singleton, FL_SINGLETON)) {
rb_singleton_class_attached(singleton, clone);
}
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;