Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@XrXr
Copy link
Member

@XrXr XrXr commented May 1, 2025

Previously, resolve_refined_method() wrote to defined_class_ptr by using
rb_method_entry_t::defined_class, which by definition can be 0. Since
*defined_class_ptr is used as a back-up when
rb_method_entry_t::defined_class is 0, this wasn't a good strategy to
not have 0 at the end. This caused a crash since it overwrote a properly
set defined_class put by a search_method* function earlier.

Since resolve_refined_method() is always called after calling a
search_method_* function which writes through defined_class_ptr already,
just don't write through deinfed_class_ptr.

[Bug #21265]

@launchable-app

This comment has been minimized.

The crash was fixed by a4dff09 ("Fix
resolving refined module-defined method"). I had a patch for this around
for a few months but never merged it. Oops!
@XrXr XrXr force-pushed the refinement-symbol-proc branch from 88600da to 096590c Compare November 11, 2025 03:17
@XrXr XrXr enabled auto-merge (rebase) November 11, 2025 03:17
@XrXr XrXr merged commit 6e6f5d3 into ruby:master Nov 11, 2025
87 checks passed
@XrXr XrXr deleted the refinement-symbol-proc branch November 11, 2025 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant