summaryrefslogtreecommitdiffstats
path: root/variable.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-31 20:19:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-31 20:19:44 +0000
commit6668092e38434b7ccd911ec52cd71fe73acc1eba (patch)
treece6815b5b38f42d01cb6680647d5ca7888c2cda2 /variable.c
parent7e0cdd6a22f2f1347ddbb6ab43e7914e7d913943 (diff)
downloadruby-6668092e38434b7ccd911ec52cd71fe73acc1eba.tar.gz
ruby-6668092e38434b7ccd911ec52cd71fe73acc1eba.tar.xz
ruby-6668092e38434b7ccd911ec52cd71fe73acc1eba.zip
* 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/trunk@21925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c3
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;
}