Actions
Bug #21265
closedCrash when proc from Symbol#to_proc called outside refinement scope
Bug #21265:
Crash when proc from Symbol#to_proc called outside refinement scope
Description
class RefinedScope
using(Module.new { refine(Kernel) { def itself = 0 } })
ITSELF = :itself.to_proc
end
RefinedScope::ITSELF[0]
../vm_method.c:1371: Assertion Failed: prepare_callable_method_entry:RB_TYPE_2_P(defined_class, RUBY_T_ICLASS, RUBY_T_MODULE): defined_class: T_FALSE
Or SEGV without -DRUBY_DEBUG.
Updated by alanwu (Alan Wu) about 1 month ago
- Status changed from Open to Closed
Applied in changeset git|6e6f5d3c32a709c891ac6aa7833376907a6c81b5.
Add test for [Bug #21265]
The crash was fixed by a4dff09be79b52288a47658964d25e5aa84fc960 ("Fix
resolving refined module-defined method"). I had a patch for this around
for a few months but never merged it. Oops!
Updated by k0kubun (Takashi Kokubun) 4 days ago
- Backport changed from 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED to 3.2: DONTNEED, 3.3: DONTNEED, 3.4: DONE
ruby_3_4 ef2d4bf51bf28cfc427388a19e4a5fe9bbbe7a7a merged revision(s) 6e6f5d3c32a709c891ac6aa7833376907a6c81b5.
Actions