1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Assume that klass of dummy head is NULL

klass of the dummy head of the subclass entries should always be NULL.
This commit is contained in:
Peter Zhu 2022-03-16 15:18:34 -04:00
parent a8703978b8
commit f38dcc78c4

View file

@ -1109,7 +1109,8 @@ rb_include_module(VALUE klass, VALUE module)
if (RB_TYPE_P(klass, T_MODULE)) { if (RB_TYPE_P(klass, T_MODULE)) {
rb_subclass_entry_t *iclass = RCLASS_SUBCLASSES(klass); rb_subclass_entry_t *iclass = RCLASS_SUBCLASSES(klass);
// skip the placeholder subclass entry at the head of the list // skip the placeholder subclass entry at the head of the list
if (iclass && !iclass->klass) { if (iclass) {
RUBY_ASSERT(!iclass->klass);
iclass = iclass->next; iclass = iclass->next;
} }