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

ruby-changes:34922

From: ktsj <ko1@a...>
Date: Wed, 30 Jul 2014 22:17:56 +0900 (JST)
Subject: [ruby-changes:34922] ktsj:r47005 (trunk): * process.c (rlimit_resource_type, rlimit_resource_value):

ktsj	2014-07-30 22:17:45 +0900 (Wed, 30 Jul 2014)

  New Revision: 47005

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

  Log:
    * process.c (rlimit_resource_type, rlimit_resource_value):
      get rid of inadvertent dynamic symbol pin-down.
    
    * re.c (match_backref_number): ditto.
    
    * signal.c (esignal_init, rb_f_kill, trap_signm): ditto.
    
    * transcode.c (econv_opts): ditto.
    
    * vm_trace.c (symbol2event_flag): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/process.c
    trunk/re.c
    trunk/signal.c
    trunk/transcode.c
    trunk/vm_trace.c
Index: re.c
===================================================================
--- re.c	(revision 47004)
+++ re.c	(revision 47005)
@@ -1082,7 +1082,7 @@ match_backref_number(VALUE match, VALUE https://github.com/ruby/ruby/blob/trunk/re.c#L1082
         return NUM2INT(backref);
 
       case T_SYMBOL:
-        name = rb_id2name(SYM2ID(backref));
+        name = RSTRING_PTR(rb_sym2str(backref));
         break;
 
       case T_STRING:
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 47004)
+++ ChangeLog	(revision 47005)
@@ -1,3 +1,16 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jul 30 22:10:29 2014  Kazuki Tsujimoto  <kazuki@c...>
+
+	* process.c (rlimit_resource_type, rlimit_resource_value):
+	  get rid of inadvertent dynamic symbol pin-down.
+
+	* re.c (match_backref_number): ditto.
+
+	* signal.c (esignal_init, rb_f_kill, trap_signm): ditto.
+
+	* transcode.c (econv_opts): ditto.
+
+	* vm_trace.c (symbol2event_flag): ditto.
+
 Wed Jul 30 21:29:39 2014  Masaki Suketa <masaki.suketa@n...>
 
 	* ext/win32ole/win32ole.c (ole_invoke): pass WIN32OLE_RECORD variant
Index: process.c
===================================================================
--- process.c	(revision 47004)
+++ process.c	(revision 47005)
@@ -4529,7 +4529,7 @@ rlimit_resource_type(VALUE rtype) https://github.com/ruby/ruby/blob/trunk/process.c#L4529
 
     switch (TYPE(rtype)) {
       case T_SYMBOL:
-        name = rb_id2name(SYM2ID(rtype));
+        name = RSTRING_PTR(rb_sym2str(rtype));
         break;
 
       default:
@@ -4564,7 +4564,7 @@ rlimit_resource_value(VALUE rval) https://github.com/ruby/ruby/blob/trunk/process.c#L4564
 
     switch (TYPE(rval)) {
       case T_SYMBOL:
-        name = rb_id2name(SYM2ID(rval));
+        name = RSTRING_PTR(rb_sym2str(rval));
         break;
 
       default:
Index: vm_trace.c
===================================================================
--- vm_trace.c	(revision 47004)
+++ vm_trace.c	(revision 47005)
@@ -700,7 +700,7 @@ symbol2event_flag(VALUE v) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L700
 #undef C
     CONST_ID(id, "a_call"); if (sym == ID2SYM(id)) return RUBY_EVENT_CALL | RUBY_EVENT_B_CALL | RUBY_EVENT_C_CALL;
     CONST_ID(id, "a_return"); if (sym == ID2SYM(id)) return RUBY_EVENT_RETURN | RUBY_EVENT_B_RETURN | RUBY_EVENT_C_RETURN;
-    rb_raise(rb_eArgError, "unknown event: %s", rb_id2name(SYM2ID(sym)));
+    rb_raise(rb_eArgError, "unknown event: %"PRIsVALUE, rb_sym2str(sym));
 }
 
 static rb_tp_t *
Index: signal.c
===================================================================
--- signal.c	(revision 47004)
+++ signal.c	(revision 47005)
@@ -301,7 +301,7 @@ esignal_init(int argc, VALUE *argv, VALU https://github.com/ruby/ruby/blob/trunk/signal.c#L301
     }
     else {
 	int len = sizeof(signame_prefix);
-	signm = SYMBOL_P(sig) ? rb_id2name(SYM2ID(sig)) : StringValuePtr(sig);
+	signm = SYMBOL_P(sig) ? RSTRING_PTR(rb_sym2str(sig)) : StringValuePtr(sig);
 	if (strncmp(signm, signame_prefix, len) == 0) {
 	    signm += len;
 	    len = 0;
@@ -408,7 +408,7 @@ rb_f_kill(int argc, const VALUE *argv) https://github.com/ruby/ruby/blob/trunk/signal.c#L408
 	break;
 
       case T_SYMBOL:
-	s = rb_id2name(SYM2ID(argv[0]));
+	s = RSTRING_PTR(rb_sym2str(argv[0]));
 	if (!s) rb_raise(rb_eArgError, "bad signal");
 	goto str_signal;
 
@@ -1044,7 +1044,7 @@ trap_signm(VALUE vsig) https://github.com/ruby/ruby/blob/trunk/signal.c#L1044
 	break;
 
       case T_SYMBOL:
-	s = rb_id2name(SYM2ID(vsig));
+	s = RSTRING_PTR(rb_sym2str(vsig));
 	if (!s) rb_raise(rb_eArgError, "bad signal");
 	goto str_signal;
 
Index: transcode.c
===================================================================
--- transcode.c	(revision 47004)
+++ transcode.c	(revision 47005)
@@ -2463,7 +2463,7 @@ econv_opts(VALUE opt, int ecflags) https://github.com/ruby/ruby/blob/trunk/transcode.c#L2463
             ecflags |= ECONV_XML_ATTR_CONTENT_DECORATOR|ECONV_XML_ATTR_QUOTE_DECORATOR|ECONV_UNDEF_HEX_CHARREF;
         }
         else if (RB_TYPE_P(v, T_SYMBOL)) {
-            rb_raise(rb_eArgError, "unexpected value for xml option: %s", rb_id2name(SYM2ID(v)));
+            rb_raise(rb_eArgError, "unexpected value for xml option: %"PRIsVALUE, rb_sym2str(v));
         }
         else {
             rb_raise(rb_eArgError, "unexpected value for xml option");

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

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