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

ruby-changes:59314

From: John <ko1@a...>
Date: Wed, 18 Dec 2019 02:27:27 +0900 (JST)
Subject: [ruby-changes:59314] 9245462499 (master): Replace debug test with assertion

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

From 9245462499e7c3216a468aadccdc11e69de8cd54 Mon Sep 17 00:00:00 2001
From: John Hawthorn <john@h...>
Date: Thu, 12 Dec 2019 22:43:00 -0800
Subject: Replace debug test with assertion

It's a Ruby bug if this ever happens check it as an assertion instead of
paying the cost of the check every time.

diff --git a/vm_method.c b/vm_method.c
index 2f1817a..bcf6b0b 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -77,10 +77,7 @@ rb_class_clear_method_cache(VALUE klass, VALUE arg) https://github.com/ruby/ruby/blob/trunk/vm_method.c#L77
 	}
     }
     else {
-	if (RCLASS_CALLABLE_M_TBL(klass) != 0) {
-	    rb_obj_info_dump(klass);
-	    rb_bug("RCLASS_CALLABLE_M_TBL(klass) != 0");
-	}
+	VM_ASSERT(RCLASS_CALLABLE_M_TBL(klass) == 0);
     }
 
     rb_class_foreach_subclass(klass, rb_class_clear_method_cache, arg);
-- 
cgit v0.10.2


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

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