aboutsummaryrefslogtreecommitdiffstats
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
commit8d8a2f2d307fb12fea60ac884f3cfde5a2813695 (patch)
tree118db20183f32eb9885773cf02dcf247e1e92cbb /vm_insnhelper.c
parent8810e45c16f4f036c96be2b9b22da58c9b4327e3 (diff)
downloadruby-8d8a2f2d307fb12fea60ac884f3cfde5a2813695.tar.gz
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;