diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-02-20 01:07:40 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-02-20 01:07:40 +0000 |
| commit | c483387f394a5ef29680173eb36a71fd9bcbdf7a (patch) | |
| tree | 10e910a7ca29b0affa5ab6b9f849306e14518d36 | |
| parent | 354e9435a8831bd3139d51704e5cad5ddfaf7a06 (diff) | |
| download | ruby-c483387f394a5ef29680173eb36a71fd9bcbdf7a.tar.gz ruby-c483387f394a5ef29680173eb36a71fd9bcbdf7a.tar.xz ruby-c483387f394a5ef29680173eb36a71fd9bcbdf7a.zip | |
* variable.c (rb_const_get_0): Object should have been the lowest
in const lookup precedence. [ruby-dev:28343]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | variable.c | 20 |
2 files changed, 15 insertions, 10 deletions
@@ -1,3 +1,8 @@ +Mon Feb 20 10:03:59 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * variable.c (rb_const_get_0): Object should have been the lowest + in const lookup precedence. [ruby-dev:28343] + Mon Feb 20 09:17:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org> * lib/delegate.rb (Delegator): should not delegate "funcall". diff --git a/variable.c b/variable.c index a559a5e23..7bd55eb0d 100644 --- a/variable.c +++ b/variable.c @@ -1302,16 +1302,16 @@ rb_const_get_0(VALUE klass, ID id, int exclude, int recurse, NODE *fallback) } } if (recurse) { - if (!n_retry) { - n_retry = 1; - tmp = 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); } @@ -1469,16 +1469,16 @@ rb_const_defined_0(VALUE klass, ID id, int exclude, int recurse, NODE* fallback) tmp = RCLASS(tmp)->super; } if (recurse) { - if (!n_retry) { - n_retry = 1; - tmp = 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 Qfalse; } |
