summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-27 17:47:21 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-27 17:47:21 +0000
commit9b94dabe77d39e72f9694ba81c8d04111ea844ee (patch)
treea99a9d30917002e060ee8a09e0e196ffbc8b12ba /class.c
parentfff5de3bd418ebb58d5a620403f9da488c7e7148 (diff)
* class.c (rb_mod_init_copy): when class is dup'ed, a metaclass of the
class should be attached to the dup'ed class, not the original class. [ruby-core:30843] [Bug #3461] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/class.c b/class.c
index 7747a4e4d5..7cc7551b62 100644
--- a/class.c
+++ b/class.c
@@ -146,6 +146,7 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
rb_obj_init_copy(clone, orig);
if (!FL_TEST(CLASS_OF(clone), FL_SINGLETON)) {
RBASIC(clone)->klass = rb_singleton_class_clone(orig);
+ rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);
}
RCLASS_SUPER(clone) = RCLASS_SUPER(orig);
if (RCLASS_IV_TBL(orig)) {