diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-14 02:11:37 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-14 02:11:37 +0000 |
commit | ae1a466401fc056ad91150dae94930e822a4ddd1 (patch) | |
tree | cf3a130c1df7eea7fe68484663715ee6899b68eb | |
parent | 33fddfe585542a06761298fcd56a5ff8d63cc3bb (diff) | |
download | ruby-ae1a466401fc056ad91150dae94930e822a4ddd1.tar.gz |
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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | object.c | 6 |
2 files changed, 8 insertions, 3 deletions
@@ -1,4 +1,7 @@ -Sat Dec 14 01:31:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> +Sat Dec 14 11:11:34 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * 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. @@ -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); |