mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Always skip dummy head of subclass in rb_prepend_module
The first node of the subclass linked list of always a dummy head, so it should be skipped.
This commit is contained in:
parent
6d8f396f37
commit
819f4f0e65
1 changed files with 1 additions and 1 deletions
2
class.c
2
class.c
|
@ -1353,7 +1353,7 @@ rb_prepend_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 if it exists
|
// skip the placeholder subclass entry at the head of the list if it exists
|
||||||
if (iclass && iclass->next) {
|
if (iclass) {
|
||||||
RUBY_ASSERT(!iclass->klass);
|
RUBY_ASSERT(!iclass->klass);
|
||||||
iclass = iclass->next;
|
iclass = iclass->next;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue