diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-14 12:23:32 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-14 12:23:32 +0000 |
commit | af103c63dce907b2c08d95a2d50f75e21b16074c (patch) | |
tree | a08afc9d220b054974e64503eb811e53c78ee6da /variable.c | |
parent | d986500059e8cacbe179a883d114b29787ca6628 (diff) |
* variable.c (rb_autoload_p): search superclasses as same as actual
loading. fixes [ruby-core:35679]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/variable.c b/variable.c index 7f813ad6d4..3c9fe7175e 100644 --- a/variable.c +++ b/variable.c @@ -1569,7 +1569,10 @@ rb_autoload_p(VALUE mod, ID id) NODE *load; const char *loading = 0; - if (!autoload_node_id(mod, id)) return Qnil; + while (!autoload_node_id(mod, id)) { + mod = RCLASS_SUPER(mod); + if (!mod) return Qnil; + } load = autoload_node(mod, id, &loading); if (!load) return Qnil; return load && (file = load->nd_lit) ? file : Qnil; |