diff options
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); |