summaryrefslogtreecommitdiff
path: root/vm_insnhelper.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
commit132d0624ec5b59d2d55fc0ccf01b53c10010d787 (patch)
treece6815b5b38f42d01cb6680647d5ca7888c2cda2 /vm_insnhelper.c
parentcd350b676813f8313e9bc3c3289f1209b04e4299 (diff)
* variable.c (rb_const_get_0), vm_insnhelper.c (vm_get_ev_const):
avoids infinite self recursion autoload. [ruby-core:21696] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 7b4fd37979..0e54dddc59 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1082,10 +1082,13 @@ vm_get_ev_const(rb_thread_t *th, const rb_iseq_t *iseq,
cref = cref->nd_next;
if (!NIL_P(klass)) {
+ VALUE am = 0;
search_continue:
if (RCLASS_IV_TBL(klass) &&
st_lookup(RCLASS_IV_TBL(klass), id, &val)) {
if (val == Qundef) {
+ if (am == klass) break;
+ am = klass;
rb_autoload_load(klass, id);
goto search_continue;
}