diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-08-17 23:28:46 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-08-18 00:34:12 +0900 |
commit | 6db3051fcc08440fb1d80617dae90ae3f97db95c (patch) | |
tree | b5e2e2b9a0de00eca366cfa4fe1d99d0ab0d03b8 /vm_method.c | |
parent | aa00f7b8ec97b8ca6e2e2b8f31825dca4a2ae91b (diff) |
Ensure VM_DEBUG_VERIFY_METHOD_CACHE code valid
Diffstat (limited to 'vm_method.c')
-rw-r--r-- | vm_method.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/vm_method.c b/vm_method.c index da891229f8..0bc32ad36f 100644 --- a/vm_method.c +++ b/vm_method.c @@ -787,10 +787,10 @@ method_entry_get_without_cache(VALUE klass, ID id, 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 * 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) 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; |