diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-02 08:07:15 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-02 08:07:15 +0000 |
commit | 8a2a01e6b1cdb141610af8464ad106f6141219d9 (patch) | |
tree | 360aa438e4af524563d42f2805cd6b43fb31812c /variable.c | |
parent | 0c6f4bb132e49600d1a61c24e162b67cc169b1dc (diff) | |
download | ruby-8a2a01e6b1cdb141610af8464ad106f6141219d9.tar.gz ruby-8a2a01e6b1cdb141610af8464ad106f6141219d9.tar.xz ruby-8a2a01e6b1cdb141610af8464ad106f6141219d9.zip |
merges r21925 from trunk into ruby_1_9_1.
* variable.c (rb_const_get_0), vm_insnhelper.c (vm_get_ev_const):
avoids infinite self recursion autoload. [ruby-core:21696]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/variable.c b/variable.c index 0cc87d7fd..b920c6797 100644 --- a/variable.c +++ b/variable.c @@ -1470,8 +1470,11 @@ rb_const_get_0(VALUE klass, ID id, int exclude, int recurse) tmp = klass; retry: while (RTEST(tmp)) { + VALUE am = 0; while (RCLASS_IV_TBL(tmp) && st_lookup(RCLASS_IV_TBL(tmp),id,&value)) { if (value == Qundef) { + if (am == tmp) break; + am = tmp; rb_autoload_load(tmp, id); continue; } |