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

ruby-changes:34361

From: nobu <ko1@a...>
Date: Mon, 16 Jun 2014 17:03:55 +0900 (JST)
Subject: [ruby-changes:34361] nobu:r46442 (trunk): vm_method.c: no RTEST on mere flag

nobu	2014-06-16 17:03:42 +0900 (Mon, 16 Jun 2014)

  New Revision: 46442

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

  Log:
    vm_method.c: no RTEST on mere flag
    
    * vm_method.c (basic_obj_respond_to): `priv` is not a VALUE but a
      mere flag, so cannot call RTEST() on it.

  Modified files:
    trunk/vm_method.c
Index: vm_method.c
===================================================================
--- vm_method.c	(revision 46441)
+++ vm_method.c	(revision 46442)
@@ -1624,7 +1624,7 @@ rb_obj_respond_to(VALUE obj, ID id, int https://github.com/ruby/ruby/blob/trunk/vm_method.c#L1624
     VALUE klass = CLASS_OF(obj);
 
     if (rb_method_basic_definition_p(klass, idRespond_to)) {
-	return basic_obj_respond_to(obj, id, !RTEST(priv));
+	return basic_obj_respond_to(obj, id, !priv);
     }
     else {
 	int argc = 1;

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

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