summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-22 12:15:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-22 12:15:34 +0000
commit65fed5dad3dbcbb60cc6ccffd4e43359ec29ffb4 (patch)
tree89d4722df33c2ec8e115078fa88cdc286842e454 /class.c
parent88695fc0ea105d16f3c40be0119c18ff7306331b (diff)
* class.c (rb_mod_init_copy): always copy singleton class.
[ruby-dev:22325] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/class.c b/class.c
index 29fe34a..35b2c98 100644
--- a/class.c
+++ b/class.c
@@ -63,6 +63,9 @@ rb_mod_init_copy(clone, orig)
VALUE clone, orig;
{
rb_obj_init_copy(clone, orig);
+ if (!FL_TEST(CLASS_OF(clone), FL_SINGLETON)) {
+ RBASIC(clone)->klass = rb_singleton_class_clone(orig);
+ }
RCLASS(clone)->super = RCLASS(orig)->super;
if (RCLASS(orig)->iv_tbl) {
ID id;