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

ruby-changes:44308

From: nobu <ko1@a...>
Date: Sun, 9 Oct 2016 18:42:23 +0900 (JST)
Subject: [ruby-changes:44308] nobu:r56381 (trunk): vm_insnhelper.c: update assertion [ci skip]

nobu	2016-10-09 18:42:17 +0900 (Sun, 09 Oct 2016)

  New Revision: 56381

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56381

  Log:
    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]

  Modified files:
    trunk/vm_insnhelper.c
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 56380)
+++ vm_insnhelper.c	(revision 56381)
@@ -40,6 +40,13 @@ static int https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L40
 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;

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

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