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

ruby-changes:41837

From: nobu <ko1@a...>
Date: Wed, 24 Feb 2016 11:38:06 +0900 (JST)
Subject: [ruby-changes:41837] nobu:r53911 (trunk): vm_method.c: for hidden object

nobu	2016-02-24 11:38:43 +0900 (Wed, 24 Feb 2016)

  New Revision: 53911

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

  Log:
    vm_method.c: for hidden object
    
    * vm_method.c (rb_method_basic_definition_p): methods of hidden
      objects cannot be overridden, return TRUE.

  Modified files:
    trunk/vm_method.c
Index: vm_method.c
===================================================================
--- vm_method.c	(revision 53910)
+++ vm_method.c	(revision 53911)
@@ -1859,7 +1859,9 @@ rb_mod_modfunc(int argc, VALUE *argv, VA https://github.com/ruby/ruby/blob/trunk/vm_method.c#L1859
 int
 rb_method_basic_definition_p(VALUE klass, ID id)
 {
-    const rb_method_entry_t *me = rb_method_entry(klass, id);
+    const rb_method_entry_t *me;
+    if (!klass) return TRUE; /* hidden object cannot be overridden */
+    me = rb_method_entry(klass, id);
     return (me && METHOD_ENTRY_BASIC(me)) ? TRUE : FALSE;
 }
 

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

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