summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-09-06 07:47:47 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-09-06 07:47:47 +0000
commitf29380628f569131bd7e917b6b9eb05734ffb81e (patch)
tree89cbb92857f1c9d3f35eadd421cbdc1bba146610 /class.c
parent20af3b306654bddff93a14216eae58c72f969b4e (diff)
* class.c (rb_include_module): should check whole ancestors to
avoid duplicate module inclusion. * string.c (trnext): should check backslash before updating "now" position. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/class.c b/class.c
index b5caf3082a..6a7e17bb6b 100644
--- a/class.c
+++ b/class.c
@@ -278,17 +278,14 @@ rb_include_module(klass, module)
for (p = RCLASS(klass)->super; p; p = RCLASS(p)->super) {
if (BUILTIN_TYPE(p) == T_ICLASS &&
RCLASS(p)->m_tbl == RCLASS(module)->m_tbl) {
- if (RCLASS(module)->super) {
- rb_include_module(p, RCLASS(module)->super);
- }
- if (changed) rb_clear_cache();
- return;
+ goto skip;
}
}
RCLASS(klass)->super = include_class_new(module, RCLASS(klass)->super);
klass = RCLASS(klass)->super;
- module = RCLASS(module)->super;
changed = 1;
+ skip:
+ module = RCLASS(module)->super;
}
if (changed) rb_clear_cache();
}