[前][次][番号順一覧][スレッド一覧]

ruby-changes:71439

From: Peter <ko1@a...>
Date: Thu, 17 Mar 2022 04:19:50 +0900 (JST)
Subject: [ruby-changes:71439] f38dcc78c4 (master): Assume that klass of dummy head is NULL

https://git.ruby-lang.org/ruby.git/commit/?id=f38dcc78c4

From f38dcc78c4302bc7d5059d540507396bd9ea930e Mon Sep 17 00:00:00 2001
From: Peter Zhu <peter@p...>
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(-)

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) https://github.com/ruby/ruby/blob/trunk/class.c#L1109
     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


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]