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

ruby-changes:57140

From: Nobuyoshi <ko1@a...>
Date: Sun, 18 Aug 2019 00:47:27 +0900 (JST)
Subject: [ruby-changes:57140] Nobuyoshi Nakada: 6db3051fcc (master): Ensure VM_DEBUG_VERIFY_METHOD_CACHE code valid

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

From 6db3051fcc08440fb1d80617dae90ae3f97db95c Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 17 Aug 2019 23:28:46 +0900
Subject: Ensure VM_DEBUG_VERIFY_METHOD_CACHE code valid


diff --git a/vm_method.c b/vm_method.c
index da89122..0bc32ad 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -787,10 +787,10 @@ method_entry_get_without_cache(VALUE klass, ID id, https://github.com/ruby/ruby/blob/trunk/vm_method.c#L787
     return me;
 }
 
-#if VM_DEBUG_VERIFY_METHOD_CACHE
 static void
 verify_method_cache(VALUE klass, ID id, VALUE defined_class, rb_method_entry_t *me)
 {
+    if (!VM_DEBUG_VERIFY_METHOD_CACHE) return;
     VALUE actual_defined_class;
     rb_method_entry_t *actual_me =
       method_entry_get_without_cache(klass, id, &actual_defined_class);
@@ -799,7 +799,6 @@ verify_method_cache(VALUE klass, ID id, VALUE defined_class, rb_method_entry_t * https://github.com/ruby/ruby/blob/trunk/vm_method.c#L799
 	rb_bug("method cache verification failed");
     }
 }
-#endif
 
 static rb_method_entry_t *
 method_entry_get(VALUE klass, ID id, VALUE *defined_class_ptr)
@@ -810,9 +809,7 @@ method_entry_get(VALUE klass, ID id, VALUE *defined_class_ptr) https://github.com/ruby/ruby/blob/trunk/vm_method.c#L809
     if (ent->method_state == GET_GLOBAL_METHOD_STATE() &&
 	ent->class_serial == RCLASS_SERIAL(klass) &&
 	ent->mid == id) {
-#if VM_DEBUG_VERIFY_METHOD_CACHE
 	verify_method_cache(klass, id, ent->defined_class, ent->me);
-#endif
 	if (defined_class_ptr) *defined_class_ptr = ent->defined_class;
 	RB_DEBUG_COUNTER_INC(mc_global_hit);
 	return ent->me;
-- 
cgit v0.10.2


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

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