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

ruby-changes:25288

From: tenderlove <ko1@a...>
Date: Sat, 27 Oct 2012 10:52:48 +0900 (JST)
Subject: [ruby-changes:25288] tenderlove:r37340 (trunk): * object.c (rb_mod_const_get): make sure the constant name is

tenderlove	2012-10-27 10:51:58 +0900 (Sat, 27 Oct 2012)

  New Revision: 37340

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

  Log:
    * object.c (rb_mod_const_get): make sure the constant name is
      converted to a string before searching. [ruby-core:48405]

  Modified files:
    trunk/ChangeLog
    trunk/object.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37339)
+++ ChangeLog	(revision 37340)
@@ -1,3 +1,8 @@
+Sat Oct 27 10:50:53 2012  Aaron Patterson <aaron@t...>
+
+	* object.c (rb_mod_const_get): make sure the constant name is
+	  converted to a string before searching. [ruby-core:48405]
+
 Sat Oct 27 10:12:13 2012  URABE Shyouhei  <shyouhei@r...>
 
 	* iseq.c (rb_iseq_compile_with_option): Instead of testing
Index: object.c
===================================================================
--- object.c	(revision 37339)
+++ object.c	(revision 37340)
@@ -1905,9 +1905,12 @@
     }
 
     if (SYMBOL_P(name)) {
-      name = rb_sym_to_s(name);
+	name = rb_sym_to_s(name);
     }
 
+    name = rb_check_string_type(name);
+    Check_Type(name, T_STRING);
+
     enc = rb_enc_get(name);
     path = RSTRING_PTR(name);
 

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

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