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

ruby-changes:32111

From: nobu <ko1@a...>
Date: Sat, 14 Dec 2013 11:11:43 +0900 (JST)
Subject: [ruby-changes:32111] nobu:r44190 (trunk): object.c: fix r44189

nobu	2013-12-14 11:11:37 +0900 (Sat, 14 Dec 2013)

  New Revision: 44190

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

  Log:
    object.c: fix r44189
    
    * object.c (rb_mod_const_get): already interned junk name may be
      valid nested class path.

  Modified files:
    trunk/ChangeLog
    trunk/object.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 44189)
+++ ChangeLog	(revision 44190)
@@ -1,4 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
-Sat Dec 14 01:31:52 2013  Nobuyoshi Nakada  <nobu@r...>
+Sat Dec 14 11:11:34 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* object.c (rb_mod_const_get): already interned junk name may be
+	  valid nested class path.
 
 	* eval.c (rb_rescue2): reuse tags pushed for body proc to protect
 	  rescue proc too.
Index: object.c
===================================================================
--- object.c	(revision 44189)
+++ object.c	(revision 44190)
@@ -2083,12 +2083,14 @@ rb_mod_const_get(int argc, VALUE *argv, https://github.com/ruby/ruby/blob/trunk/object.c#L2083
 	rb_scan_args(argc, argv, "11", &name, &recur);
     }
 
-    id = rb_check_id(&name);
-    if (id) {
+    if (SYMBOL_P(name)) {
+	id = ID2SYM(name);
 	if (!rb_is_const_id(id)) goto wrong_id;
 	return RTEST(recur) ? rb_const_get(mod, id) : rb_const_get_at(mod, id);
     }
 
+    name = StringValue(name);
+
     enc = rb_enc_get(name);
     path = RSTRING_PTR(name);
 

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

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