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

ruby-changes:34921

From: nobu <ko1@a...>
Date: Wed, 30 Jul 2014 21:36:53 +0900 (JST)
Subject: [ruby-changes:34921] nobu:r47004 (trunk): thread.c, vm_method.c: avoid inadvertent pin-down

nobu	2014-07-30 21:36:34 +0900 (Wed, 30 Jul 2014)

  New Revision: 47004

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

  Log:
    thread.c, vm_method.c: avoid inadvertent pin-down
    
    * thread.c (rb_thread_variable_set): get rid of inadvertent dynamic
      symbol pin-down.
    
    * vm_method.c (obj_respond_to): ditto.

  Modified files:
    trunk/thread.c
    trunk/vm_method.c
Index: thread.c
===================================================================
--- thread.c	(revision 47003)
+++ thread.c	(revision 47004)
@@ -2928,7 +2928,7 @@ rb_thread_variable_set(VALUE thread, VAL https://github.com/ruby/ruby/blob/trunk/thread.c#L2928
     }
 
     locals = rb_ivar_get(thread, id_locals);
-    return rb_hash_aset(locals, ID2SYM(rb_to_id(id)), val);
+    return rb_hash_aset(locals, rb_to_symbol(id), val);
 }
 
 /*
Index: vm_method.c
===================================================================
--- vm_method.c	(revision 47003)
+++ vm_method.c	(revision 47004)
@@ -1694,7 +1694,7 @@ obj_respond_to(int argc, VALUE *argv, VA https://github.com/ruby/ruby/blob/trunk/vm_method.c#L1694
     if (!(id = rb_check_id(&mid))) {
 	if (!rb_method_basic_definition_p(CLASS_OF(obj), idRespond_to_missing)) {
 	    VALUE args[2];
-	    args[0] = ID2SYM(rb_to_id(mid));
+	    args[0] = rb_to_symbol(mid);
 	    args[1] = priv;
 	    return rb_funcall2(obj, idRespond_to_missing, 2, args);
 	}

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

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