diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2021-06-17 17:47:11 -0400 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-06-30 10:49:27 +0900 |
commit | 3dd3ea092acead6179033f2c95525ffc5b8bb6ff (patch) | |
tree | d46ba269e49deb686ff0069755f514dcbe2035e8 /regexec.c | |
parent | dcd1eedba7af06cdb7f81f1fc4866088665c9d99 (diff) |
Use Module#ancestors order in recursive constant lookup
Before this commit, const_get with inherit=true and constant lookup
expressions searched the ancestors of the starting point in an order
different from `starting_point.ancestors`.
Items in the ancestry list introduced through prepend were searched
after searching the module they were prepended into. This oddity allowed
for situations where constant lookups gave different results even though
`starting_point.ancestors` is the same.
Do the lookup in the same order as `starting_point.ancestors` by
skipping classes and modules that have an origin iclass. The origin
iclass is in the super chain after the prepended modules.
Note that just like before this commit, the starting point of the
constant lookup is always the first item that we search, regardless of
the presence of any prepended modules.
[Bug #17887]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4585
Diffstat (limited to 'regexec.c')
0 files changed, 0 insertions, 0 deletions