ruby-changes:62089
From: Nobuyoshi <ko1@a...>
Date: Tue, 30 Jun 2020 19:32:58 +0900 (JST)
Subject: [ruby-changes:62089] 1351374bd1 (master): Split visibility cases
https://git.ruby-lang.org/ruby.git/commit/?id=1351374bd1 From 1351374bd14d4d134726889ba195609b4f745ea6 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Wed, 3 Jun 2020 08:40:11 +0900 Subject: Split visibility cases diff --git a/vm_method.c b/vm_method.c index 2b2e28e..d8d1552 100644 --- a/vm_method.c +++ b/vm_method.c @@ -1304,10 +1304,15 @@ rb_method_boundp(VALUE klass, ID id, int ex) https://github.com/ruby/ruby/blob/trunk/vm_method.c#L1304 } if (me != NULL) { - if ((ex & ~BOUND_RESPONDS) && - ((METHOD_ENTRY_VISI(me) == METHOD_VISI_PRIVATE) || - ((ex & BOUND_RESPONDS) && (METHOD_ENTRY_VISI(me) == METHOD_VISI_PROTECTED)))) { - return 0; + if (ex & ~BOUND_RESPONDS) { + switch (METHOD_ENTRY_VISI(me)) { + case METHOD_VISI_PRIVATE: + return 0; + case METHOD_VISI_PROTECTED: + if (ex & BOUND_RESPONDS) return 0; + default: + break; + } } if (me->def->type == VM_METHOD_TYPE_NOTIMPLEMENTED) { -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/