From db2f9b17e338e6f575310a064e9dd2dafbd93bff Mon Sep 17 00:00:00 2001 From: yugui Date: Mon, 2 Feb 2009 08:07:15 +0000 Subject: 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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_insnhelper.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'vm_insnhelper.c') 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; } -- cgit v1.2.3