diff options
author | Jean Boussier <jean.boussier@gmail.com> | 2019-05-07 12:00:57 +0200 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-05-07 21:20:01 +0900 |
commit | 7d805e67f3275aef066d77aa9c32bef715c362ed (patch) | |
tree | a380ab7eb259a345eaa9485d28a4c71969647d3a /object.c | |
parent | 6786fe44dcbb560d896bb9bb5baa9dc74677ce17 (diff) | |
download | bundler-7d805e67f3275aef066d77aa9c32bef715c362ed.tar.gz |
Avoid triggering autoload in Module#const_defined?(String)
[Bug #15780]
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -2694,16 +2694,19 @@ rb_mod_const_defined(int argc, VALUE *argv, VALUE mod) if (!RTEST(recur)) { if (!rb_const_defined_at(mod, id)) return Qfalse; + if (p == pend) return Qtrue; mod = rb_const_get_at(mod, id); } else if (beglen == 0) { if (!rb_const_defined(mod, id)) return Qfalse; + if (p == pend) return Qtrue; mod = rb_const_get(mod, id); } else { if (!rb_const_defined_from(mod, id)) return Qfalse; + if (p == pend) return Qtrue; mod = rb_const_get_from(mod, id); } #endif |