1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* object.c (rb_obj_clone): do not touch age (FL_PROMOTED[01]) because

rb_obj_alloc() can return old object in debug.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2015-03-18 21:31:55 +00:00
parent 5f879f76d7
commit 6964df9a21
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Thu Mar 19 06:30:35 2015 Koichi Sasada <ko1@atdot.net>
* object.c (rb_obj_clone): do not touch age (FL_PROMOTED[01]) because
rb_obj_alloc() can return old object in debug.
Thu Mar 19 06:29:28 2015 Koichi Sasada <ko1@atdot.net>
* test/objspace/test_objspace.rb: flag name was changed

View file

@ -328,7 +328,7 @@ 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);
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);