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

ruby-changes:59201

From: Aaron <ko1@a...>
Date: Thu, 12 Dec 2019 03:13:33 +0900 (JST)
Subject: [ruby-changes:59201] 0f90630983 (master): Update method tables only if there is a class ext pointer

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

From 0f90630983db3257c544c698761a00456af81d85 Mon Sep 17 00:00:00 2001
From: Aaron Patterson <tenderlove@r...>
Date: Wed, 11 Dec 2019 10:12:14 -0800
Subject: Update method tables only if there is a class ext pointer

This makes reference updating look similar to marking, and may avoid
dereferencing a wrong pointer.

diff --git a/gc.c b/gc.c
index 3a62f57..493a156 100644
--- a/gc.c
+++ b/gc.c
@@ -8179,14 +8179,12 @@ gc_update_object_references(rb_objspace_t *objspace, VALUE obj) https://github.com/ruby/ruby/blob/trunk/gc.c#L8179
     switch (BUILTIN_TYPE(obj)) {
       case T_CLASS:
       case T_MODULE:
-        update_m_tbl(objspace, RCLASS_M_TBL(obj));
         if (RCLASS_SUPER((VALUE)obj)) {
             UPDATE_IF_MOVED(objspace, RCLASS(obj)->super);
         }
         if (!RCLASS_EXT(obj)) break;
-        if (RCLASS_IV_TBL(obj)) {
-            gc_update_tbl_refs(objspace, RCLASS_IV_TBL(obj));
-        }
+        update_m_tbl(objspace, RCLASS_M_TBL(obj));
+        gc_update_tbl_refs(objspace, RCLASS_IV_TBL(obj));
         update_class_ext(objspace, RCLASS_EXT(obj));
         update_const_tbl(objspace, RCLASS_CONST_TBL(obj));
         break;
-- 
cgit v0.10.2


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

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