summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-22 00:50:33 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-22 00:50:33 +0000
commit9e11c028e3ff12da9e44f1ece7d100b84834e183 (patch)
treee4cb1f38eaef871e9132a97a9dc5ef96f71afe55 /class.c
parent941bd1c392d9213193804ef9be503c5d039dda04 (diff)
merge revision(s) 45076: [Backport #9535]
* class.c (rb_mod_init_copy): do nothing if copying self. [ruby-dev:47989] [Bug #9535] * hash.c (rb_hash_initialize_copy): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@45091 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 02e682688c..ca029895ea 100644
--- a/class.c
+++ b/class.c
@@ -180,6 +180,7 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
if (RB_TYPE_P(clone, T_CLASS)) {
class_init_copy_check(clone, orig);
}
+ if (clone == orig) return clone;
rb_obj_init_copy(clone, orig);
if (!FL_TEST(CLASS_OF(clone), FL_SINGLETON)) {
RBASIC(clone)->klass = rb_singleton_class_clone(orig);