diff --git a/class.c b/class.c index 28743a229e..572275f5ce 100644 --- a/class.c +++ b/class.c @@ -1109,7 +1109,8 @@ rb_include_module(VALUE klass, VALUE module) if (RB_TYPE_P(klass, T_MODULE)) { rb_subclass_entry_t *iclass = RCLASS_SUBCLASSES(klass); // skip the placeholder subclass entry at the head of the list - if (iclass && !iclass->klass) { + if (iclass) { + RUBY_ASSERT(!iclass->klass); iclass = iclass->next; }