diff options
author | Alan Wu <[email protected]> | 2021-05-11 12:05:06 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-11 12:05:06 -0400 |
commit | 39a2ba5cc559900c30c3143da32446c2f20a7484 (patch) | |
tree | 2069e0e787134fd79c46097e11198ded6a595a99 /ractor.c | |
parent | 010bb0883e67f9f4c8e609266e22c0a12163549a (diff) |
Method cache: fix refinement entry handling
To invalidate some callable method entries, we replace the entry in the
class. Most types of method entries are on the method table of the
origin class, but refinement entries without an orig_me are housed in
the method table of the class itself. They are there because refinements
take priority over prepended methods.
By unconditionally inserting a copy of the refinement entry into the
origin class, clearing the method cache created situations where there
are refinement entry duplicates in the lookup chain, leading to infinite
loops and other problems.
Update the replacement logic to use the right class that houses the
method entry. Also, be more selective about cache invalidation when
moving refinement entries for prepend. This avoids calling
clear_method_cache_by_id_in_class() before refinement entries are in the
place it expects.
[Bug #17806]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4386
Merged-By: XrXr
Diffstat (limited to 'ractor.c')
0 files changed, 0 insertions, 0 deletions