mirror of
https://github.com/ruby/ruby.git
synced 2025-09-17 17:43:59 +02:00
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
This commit is contained in:
parent
045c0422ac
commit
db2f9b17e3
4 changed files with 19 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Sun Feb 1 05:19:43 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* variable.c (rb_const_get_0), vm_insnhelper.c (vm_get_ev_const):
|
||||||
|
avoids infinite self recursion autoload. [ruby-core:21696]
|
||||||
|
|
||||||
Fri Jan 30 14:31:14 2009 NAKAMURA Usaku <usa@ruby-lang.org>
|
Fri Jan 30 14:31:14 2009 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* tool/make-snapshot (prereq): remove enc.mk from tarball because
|
* tool/make-snapshot (prereq): remove enc.mk from tarball because
|
||||||
|
|
|
@ -59,3 +59,11 @@ assert_equal 'okok', %q{
|
||||||
[t1.value, t2.value].join
|
[t1.value, t2.value].join
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert_finish 5, %q{
|
||||||
|
autoload :ZZZ, File.expand_path(__FILE__)
|
||||||
|
begin
|
||||||
|
ZZZ
|
||||||
|
rescue NameError
|
||||||
|
end
|
||||||
|
}, '[ruby-core:21696]'
|
||||||
|
|
||||||
|
|
|
@ -1470,8 +1470,11 @@ rb_const_get_0(VALUE klass, ID id, int exclude, int recurse)
|
||||||
tmp = klass;
|
tmp = klass;
|
||||||
retry:
|
retry:
|
||||||
while (RTEST(tmp)) {
|
while (RTEST(tmp)) {
|
||||||
|
VALUE am = 0;
|
||||||
while (RCLASS_IV_TBL(tmp) && st_lookup(RCLASS_IV_TBL(tmp),id,&value)) {
|
while (RCLASS_IV_TBL(tmp) && st_lookup(RCLASS_IV_TBL(tmp),id,&value)) {
|
||||||
if (value == Qundef) {
|
if (value == Qundef) {
|
||||||
|
if (am == tmp) break;
|
||||||
|
am = tmp;
|
||||||
rb_autoload_load(tmp, id);
|
rb_autoload_load(tmp, id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1082,10 +1082,13 @@ vm_get_ev_const(rb_thread_t *th, const rb_iseq_t *iseq,
|
||||||
cref = cref->nd_next;
|
cref = cref->nd_next;
|
||||||
|
|
||||||
if (!NIL_P(klass)) {
|
if (!NIL_P(klass)) {
|
||||||
|
VALUE am = 0;
|
||||||
search_continue:
|
search_continue:
|
||||||
if (RCLASS_IV_TBL(klass) &&
|
if (RCLASS_IV_TBL(klass) &&
|
||||||
st_lookup(RCLASS_IV_TBL(klass), id, &val)) {
|
st_lookup(RCLASS_IV_TBL(klass), id, &val)) {
|
||||||
if (val == Qundef) {
|
if (val == Qundef) {
|
||||||
|
if (am == klass) break;
|
||||||
|
am = klass;
|
||||||
rb_autoload_load(klass, id);
|
rb_autoload_load(klass, id);
|
||||||
goto search_continue;
|
goto search_continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue