diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-22 12:15:34 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-22 12:15:34 +0000 |
commit | c12a5acfc2b0a97beaff67513f695555f668a4b9 (patch) | |
tree | 89d4722df33c2ec8e115078fa88cdc286842e454 /class.c | |
parent | 1cffc0574cf57a357b02b916500f7a901b553713 (diff) | |
download | ruby-c12a5acfc2b0a97beaff67513f695555f668a4b9.tar.gz ruby-c12a5acfc2b0a97beaff67513f695555f668a4b9.tar.xz ruby-c12a5acfc2b0a97beaff67513f695555f668a4b9.zip |
* class.c (rb_mod_init_copy): always copy singleton class.
[ruby-dev:22325]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; |