From f38dcc78c4302bc7d5059d540507396bd9ea930e Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 16 Mar 2022 15:18:34 -0400 Subject: Assume that klass of dummy head is NULL klass of the dummy head of the subclass entries should always be NULL. --- class.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'class.c') 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; } -- cgit v1.2.1