ruby-changes:37936
From: ko1 <ko1@a...>
Date: Thu, 19 Mar 2015 06:32:03 +0900 (JST)
Subject: [ruby-changes:37936] ko1:r50017 (trunk): * object.c (rb_obj_clone): do not touch age (FL_PROMOTED[01]) because
ko1 2015-03-19 06:31:55 +0900 (Thu, 19 Mar 2015) New Revision: 50017 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50017 Log: * object.c (rb_obj_clone): do not touch age (FL_PROMOTED[01]) because rb_obj_alloc() can return old object in debug. Modified files: trunk/ChangeLog trunk/object.c Index: ChangeLog =================================================================== --- ChangeLog (revision 50016) +++ ChangeLog (revision 50017) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Mar 19 06:30:35 2015 Koichi Sasada <ko1@a...> + + * 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@a...> * test/objspace/test_objspace.rb: flag name was changed Index: object.c =================================================================== --- object.c (revision 50016) +++ object.c (revision 50017) @@ -328,7 +328,7 @@ rb_obj_clone(VALUE obj) https://github.com/ruby/ruby/blob/trunk/object.c#L328 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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/