summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-09 09:42:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-09 09:42:17 +0000
commit41f7aa646fcb88dc50e401d08a2750ebf2085dfb (patch)
tree118db20183f32eb9885773cf02dcf247e1e92cbb /vm_insnhelper.c
parenta23878c3f5f78522d1c977ff59df936a16abcaa6 (diff)
vm_insnhelper.c: update assertion [ci skip]
* vm_insnhelper.c (callable_class_p): update assertion as callable class may be T_MODULE or I_ICLASS which refines a module since r56213. [Feature #12534] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index e17f9ba382..d9c2087243 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -40,6 +40,13 @@ static int
callable_class_p(VALUE klass)
{
#if VM_CHECK_MODE >= 2
+ if (!klass) return FALSE;
+ switch (RB_BUILTIN_TYPE(klass)) {
+ case T_ICLASS:
+ if (!RB_TYPE_P(RCLASS_SUPER(klass), T_MODULE)) break;
+ case T_MODULE:
+ return TRUE;
+ }
while (klass) {
if (klass == rb_cBasicObject) {
return TRUE;