Skip to content

Commit b8b26d0

Browse files
committed
* 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
1 parent 28eb591 commit b8b26d0

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

ChangeLog

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Fri May 24 02:57:17 2013 Koichi Sasada <ko1@atdot.net>
2+
3+
* object.c (rb_obj_clone): should not propagate OLDGEN status.
4+
This propagation had caused WB miss for class.
5+
16
Thu May 23 17:35:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
27

38
* load.c (loaded_feature_path): fix invalid read by index underflow.

object.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,15 @@ rb_obj_clone(VALUE obj)
335335
rb_raise(rb_eTypeError, "can't clone %s", rb_obj_classname(obj));
336336
}
337337
clone = rb_obj_alloc(rb_obj_class(obj));
338+
RBASIC(clone)->flags &= (FL_TAINT|FL_UNTRUSTED);
339+
RBASIC(clone)->flags |= RBASIC(obj)->flags & ~(FL_OLDGEN|FL_FREEZE|FL_FINALIZE);
340+
338341
singleton = rb_singleton_class_clone_and_attach(obj, clone);
339342
RBASIC_SET_CLASS(clone, singleton);
340343
if (FL_TEST(singleton, FL_SINGLETON)) {
341344
rb_singleton_class_attached(singleton, clone);
342345
}
343-
RBASIC(clone)->flags &= (FL_TAINT|FL_UNTRUSTED);
344-
RBASIC(clone)->flags |= RBASIC(obj)->flags & ~(FL_FREEZE|FL_FINALIZE);
346+
345347
init_copy(clone, obj);
346348
rb_funcall(clone, id_init_clone, 1, obj);
347349
RBASIC(clone)->flags |= RBASIC(obj)->flags & FL_FREEZE;

0 commit comments

Comments
 (0)