summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'class.c')
-rw-r--r--class.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/class.c b/class.c
index 32ee98be725..12d03f15e4d 100644
--- a/class.c
+++ b/class.c
@@ -361,8 +361,10 @@ rb_include_module(klass, module)
/* ignore if the module included already in superclasses */
for (p = RCLASS(klass)->super; p; p = RCLASS(p)->super) {
if (BUILTIN_TYPE(p) == T_ICLASS) {
- if (RCLASS(p)->m_tbl == RCLASS(module)->m_tbl)
+ if (RCLASS(p)->m_tbl == RCLASS(module)->m_tbl) {
+ c = p; /* move insertion point */
goto skip;
+ }
}
}
RCLASS(c)->super = include_class_new(module, RCLASS(c)->super);