summaryrefslogtreecommitdiffstats
path: root/object.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-22 16:37:22 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-22 16:37:22 +0000
commitb93143a9f63d45f8500d774c190e7ef9429cb730 (patch)
treeaf2795092963cbc0019eeea417ffae1ba24637c2 /object.c
parent43afbeeac449321f03cb2a9c38572c0287d55b24 (diff)
downloadruby-b93143a9f63d45f8500d774c190e7ef9429cb730.tar.gz
ruby-b93143a9f63d45f8500d774c190e7ef9429cb730.tar.xz
ruby-b93143a9f63d45f8500d774c190e7ef9429cb730.zip
* object.c (rb_obj_clone): defer copying freezing state after
calling initialize_copy(). [ruby-dev:20276] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/object.c b/object.c
index c79b12774..d355c01fa 100644
--- a/object.c
+++ b/object.c
@@ -142,8 +142,9 @@ rb_obj_clone(obj)
}
clone = rb_obj_alloc(rb_obj_class(obj));
RBASIC(clone)->klass = rb_singleton_class_clone(obj);
- RBASIC(clone)->flags = RBASIC(obj)->flags | FL_TEST(clone, FL_TAINT);
+ RBASIC(clone)->flags = (RBASIC(obj)->flags | FL_TEST(clone, FL_TAINT)) & ~FL_FREEZE;
init_copy(clone, obj);
+ RBASIC(clone)->flags |= RBASIC(obj)->flags & FL_FREEZE;
return clone;
}