aboutsummaryrefslogtreecommitdiffstats
path: root/include/ruby
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-01 02:10:19 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-01 02:10:19 +0000
commitdfe6abce23ded858857927055f4d9103839c5723 (patch)
treec548a2cd2aeb418af18c98a7856ed7b70ac19ed6 /include/ruby
parentc913031f18f2ac6d4cffe212e23e5aead07e2c94 (diff)
downloadruby-dfe6abce23ded858857927055f4d9103839c5723.tar.gz
should not copy promoted flags.
* include/ruby/ruby.h (rb_clone_setup): should not copy some flags (FL_PROMOTED0|FL_PROMOTED1|FL_FINALIZE). [Bug #13775] * test/ruby/test_object.rb: add a test (note that this test will fail only when RGENGC_CHECK_MODE >= 2). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/ruby.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 460dc96230..51dadc9819 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -2028,7 +2028,8 @@ rb_special_const_p(VALUE obj)
static inline void
rb_clone_setup(VALUE clone, VALUE obj)
{
- rb_obj_setup(clone, rb_singleton_class_clone(obj), RBASIC(obj)->flags);
+ rb_obj_setup(clone, rb_singleton_class_clone(obj),
+ RBASIC(obj)->flags & ~(FL_PROMOTED0|FL_PROMOTED1|FL_FINALIZE));
rb_singleton_class_attached(RBASIC_CLASS(clone), clone);
if (RB_FL_TEST(obj, RUBY_FL_EXIVAR)) rb_copy_generic_ivar(clone, obj);
}