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

ruby-changes:32681

From: nobu <ko1@a...>
Date: Thu, 30 Jan 2014 17:43:07 +0900 (JST)
Subject: [ruby-changes:32681] nobu:r44760 (trunk): vm_eval.c: omit klass

nobu	2014-01-30 17:43:04 +0900 (Thu, 30 Jan 2014)

  New Revision: 44760

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44760

  Log:
    vm_eval.c: omit klass
    
    * vm_eval.c (rb_search_method_entry): also Qfalse and Qnil are
      immediate values, so have no RBASIC.  omit klass, which is 0.

  Modified files:
    trunk/vm_eval.c
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 44759)
+++ vm_eval.c	(revision 44760)
@@ -487,19 +487,18 @@ rb_search_method_entry(VALUE recv, ID mi https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L487
     VALUE klass = CLASS_OF(recv);
 
     if (!klass) {
-        VALUE flags, klass;
-        if (IMMEDIATE_P(recv)) {
+        VALUE flags;
+        if (SPECIAL_CONST_P(recv)) {
             rb_raise(rb_eNotImpError,
                      "method `%"PRIsVALUE"' called on unexpected immediate object (%p)",
                      rb_id2str(mid), (void *)recv);
         }
         flags = RBASIC(recv)->flags;
-        klass = RBASIC(recv)->klass;
         if (flags == 0) {
             rb_raise(rb_eNotImpError,
                      "method `%"PRIsVALUE"' called on terminated object"
-                     " (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")",
-                     rb_id2str(mid), (void *)recv, flags, klass);
+                     " (%p flags=0x%"PRIxVALUE")",
+                     rb_id2str(mid), (void *)recv, flags);
         }
         else {
             int type = BUILTIN_TYPE(recv);
@@ -507,18 +506,18 @@ rb_search_method_entry(VALUE recv, ID mi https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L506
             if (typestr && T_OBJECT <= type && type < T_NIL)
                 rb_raise(rb_eNotImpError,
                          "method `%"PRIsVALUE"' called on hidden %s object"
-                         " (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")",
-                         rb_id2str(mid), typestr, (void *)recv, flags, klass);
+                         " (%p flags=0x%"PRIxVALUE")",
+                         rb_id2str(mid), typestr, (void *)recv, flags);
             if (typestr)
                 rb_raise(rb_eNotImpError,
                          "method `%"PRIsVALUE"' called on unexpected %s object"
-                         " (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")",
-                         rb_id2str(mid), typestr, (void *)recv, flags, klass);
+                         " (%p flags=0x%"PRIxVALUE")",
+                         rb_id2str(mid), typestr, (void *)recv, flags);
             else
                 rb_raise(rb_eNotImpError,
                          "method `%"PRIsVALUE"' called on broken T_???" "(0x%02x) object"
-                         " (%p flags=0x%"PRIxVALUE" klass=0x%"PRIxVALUE")",
-                         rb_id2str(mid), type, (void *)recv, flags, klass);
+                         " (%p flags=0x%"PRIxVALUE")",
+                         rb_id2str(mid), type, (void *)recv, flags);
         }
     }
     return rb_method_entry(klass, mid, defined_class_ptr);

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

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