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

ruby-changes:67537

From: Nobuyoshi <ko1@a...>
Date: Wed, 1 Sep 2021 21:21:44 +0900 (JST)
Subject: [ruby-changes:67537] 10ebf87428 (master): Assert not to be UNDEF visibility

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

From 10ebf87428fa41dcbb179f8a35428fb63dc69d5c Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 1 Sep 2021 18:45:03 +0900
Subject: Assert not to be UNDEF visibility

Any defined methods, bound to any classes/modules and not being
UNDEFINED_METHOD_ENTRY_P, should not be METHOD_VISI_UNDEF.
---
 class.c | 1 +
 proc.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/class.c b/class.c
index 4c469ff..b7247e7 100644
--- a/class.c
+++ b/class.c
@@ -1435,6 +1435,7 @@ method_entry_i(ID key, VALUE value, void *data) https://github.com/ruby/ruby/blob/trunk/class.c#L1435
 	}
 	else {
 	    type = METHOD_ENTRY_VISI(me);
+	    RUBY_ASSERT(type != METHOD_VISI_UNDEF);
 	}
 	st_add_direct(arg->list, key, (st_data_t)type);
     }
diff --git a/proc.c b/proc.c
index d4236d0..bf04f4c 100644
--- a/proc.c
+++ b/proc.c
@@ -1657,6 +1657,7 @@ mnew_internal(const rb_method_entry_t *me, VALUE klass, VALUE iclass, https://github.com/ruby/ruby/blob/trunk/proc.c#L1657
     }
     if (visi == METHOD_VISI_UNDEF) {
 	visi = METHOD_ENTRY_VISI(me);
+	RUBY_ASSERT(visi != METHOD_VISI_UNDEF); /* !UNDEFINED_METHOD_ENTRY_P(me) */
 	if (scope && (visi != METHOD_VISI_PUBLIC)) {
 	    if (!error) return Qnil;
 	    rb_print_inaccessible(klass, id, visi);
-- 
cgit v1.1


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

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