summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-14 02:11:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-14 02:11:37 +0000
commitae1a466401fc056ad91150dae94930e822a4ddd1 (patch)
treecf3a130c1df7eea7fe68484663715ee6899b68eb /object.c
parent33fddfe585542a06761298fcd56a5ff8d63cc3bb (diff)
object.c: fix r44189
* object.c (rb_mod_const_get): already interned junk name may be valid nested class path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/object.c b/object.c
index fce1ea3..a7dd8c6 100644
--- a/object.c
+++ b/object.c
@@ -2083,12 +2083,14 @@ rb_mod_const_get(int argc, VALUE *argv, VALUE mod)
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);