[前][次][番号順一覧][スレッド一覧]

ruby-changes:31897

From: nari <ko1@a...>
Date: Tue, 3 Dec 2013 20:24:16 +0900 (JST)
Subject: [ruby-changes:31897] nari:r43976 (trunk): * object.c (rb_obj_clone): Protect FL_PROMOTED and FL_WB_PROTECTED

nari	2013-12-03 20:24:11 +0900 (Tue, 03 Dec 2013)

  New Revision: 43976

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43976

  Log:
    * object.c (rb_obj_clone): Protect FL_PROMOTED and FL_WB_PROTECTED
      flags of a destination object.

  Modified files:
    trunk/ChangeLog
    trunk/object.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43975)
+++ ChangeLog	(revision 43976)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Dec  3 20:18:46 2013  Narihiro Nakamura  <authornari@g...>
+
+	* object.c (rb_obj_clone): Protect FL_PROMOTED and FL_WB_PROTECTED
+	  flags of a destination object.
+
 Tue Dec  3 20:16:38 2013  Masaki Matsushita  <glass.saga@g...>
 
 	* array.c (rb_hash_rehash): use hash_alloc() instead of rb_hash_new().
Index: object.c
===================================================================
--- object.c	(revision 43975)
+++ object.c	(revision 43976)
@@ -335,7 +335,7 @@ rb_obj_clone(VALUE obj) https://github.com/ruby/ruby/blob/trunk/object.c#L335
         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_PROMOTED|FL_WB_PROTECTED);
     RBASIC(clone)->flags |= RBASIC(obj)->flags & ~(FL_PROMOTED|FL_FREEZE|FL_FINALIZE);
 
     singleton = rb_singleton_class_clone_and_attach(obj, clone);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]