зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
33fddfe585
Коммит
ae1a466401
|
@ -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.
|
||||
|
|
6
object.c
6
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);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче