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 | 61ef2fa9f683c9591f68f96bae3b4ecd793857f2 (patch) | |
tree | 10e910a7ca29b0affa5ab6b9f849306e14518d36 | |
parent | a25ab421375ebcdd860a01bf14870053868b74a5 (diff) |
* variable.c (rb_const_get_0): Object should have been the lowest
in const lookup precedence. [ruby-dev:28343]
git-svn-id: svn+ssh://ci.ruby-lang.org/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 a559a5e23d..7bd55eb0db 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; } |