Fix the placeholder subclass entry skipping [Bug #18489]

This commit is contained in:
Nobuyoshi Nakada 2022-01-17 01:56:31 +09:00
parent e53962b9e1
commit f3c77bd480
Notes: git 2022-01-17 21:23:59 +09:00
2 changed files with 10 additions and 2 deletions

View file

@ -1054,8 +1054,7 @@ 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->next) {
RUBY_ASSERT(!iclass->klass);
if (iclass && !iclass->klass) {
iclass = iclass->next;
}