зеркало из https://github.com/github/ruby.git
* variable.c (rb_const_get_0): skip ruby_wrapper in const search
to give it lower priority (just above Object). need not to change rb_const_defined_0() since it's only a precedence matter; they are defined anyway. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
110a9f783d
Коммит
d16c035975
|
@ -1,3 +1,10 @@
|
|||
Sat Feb 18 01:01:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* variable.c (rb_const_get_0): skip ruby_wrapper in const search
|
||||
to give it lower priority (just above Object). need not to
|
||||
change rb_const_defined_0() since it's only a precedence matter;
|
||||
they are defined anyway.
|
||||
|
||||
Sat Feb 18 00:22:39 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* lib/tracer.rb: merged a minor clarification patch from Daniel
|
||||
|
|
2
env.h
2
env.h
|
@ -85,4 +85,6 @@ struct BLOCK {
|
|||
#define BLOCK_LAMBDA 2
|
||||
#define BLOCK_FROM_METHOD 4
|
||||
|
||||
RUBY_EXTERN VALUE ruby_wrapper;
|
||||
|
||||
#endif /* ENV_H */
|
||||
|
|
2
eval.c
2
eval.c
|
@ -951,7 +951,7 @@ static struct tag *prot_tag;
|
|||
#define TAG_THREAD 0xa
|
||||
#define TAG_MASK 0xf
|
||||
|
||||
static VALUE ruby_wrapper; /* security wrapper */
|
||||
VALUE ruby_wrapper; /* security wrapper */
|
||||
|
||||
static NODE *ruby_cref = 0;
|
||||
static NODE *top_cref;
|
||||
|
|
16
variable.c
16
variable.c
|
@ -1297,18 +1297,21 @@ rb_const_get_0(VALUE klass, ID id, int exclude, int recurse, NODE *fallback)
|
|||
if (!recurse) break;
|
||||
tmp = RCLASS(tmp)->super;
|
||||
if (tmp == rb_cObject) break;
|
||||
if (ruby_wrapper && tmp && RBASIC(tmp)->klass == ruby_wrapper) {
|
||||
tmp = RCLASS(tmp)->super;
|
||||
}
|
||||
}
|
||||
if (recurse) {
|
||||
if (!n_retry) {
|
||||
n_retry = 1;
|
||||
tmp = ruby_wrapper ? ruby_wrapper : rb_cObject;
|
||||
goto retry;
|
||||
}
|
||||
if (fallback) {
|
||||
tmp = fallback->nd_clss;
|
||||
fallback = fallback->nd_next;
|
||||
goto retry;
|
||||
}
|
||||
if (!n_retry) {
|
||||
n_retry = 1;
|
||||
tmp = rb_cObject;
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
return const_missing(klass, id);
|
||||
}
|
||||
|
@ -1464,12 +1467,11 @@ rb_const_defined_0(VALUE klass, ID id, int exclude, int recurse, NODE* fallback)
|
|||
}
|
||||
if (!recurse) break;
|
||||
tmp = RCLASS(tmp)->super;
|
||||
if (tmp == rb_cObject) break;
|
||||
}
|
||||
if (recurse) {
|
||||
if (!n_retry) {
|
||||
n_retry = 1;
|
||||
tmp = rb_cObject;
|
||||
tmp = ruby_wrapper ? ruby_wrapper : rb_cObject;
|
||||
goto retry;
|
||||
}
|
||||
if (fallback) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче