diff options
| author | Daisuke Aritomo <osyoyu@osyoyu.com> | 2025-12-15 18:04:57 +0900 |
|---|---|---|
| committer | John Hawthorn <john@hawthorn.email> | 2025-12-16 17:15:59 -0800 |
| commit | cbcbbb2fbe57fb17b3bd6b93244c4f37f3626c7e (patch) | |
| tree | 5f897805c144b7abda652d40d115dbd9b0498231 /test/ruby/test_thread_queue.rb | |
| parent | 2d0140664436d85684a98a81f4fb103c186895b9 (diff) | |
Let Ractor::IsolationError report correct constant path
Before this patch, Ractor::IsolationError reported an incorrect constant
path when constant was found through `rb_const_get_0()`.
In this code, Ractor::IsolationError reported illegal access against
`M::TOPLEVEL`, where it should be `Object::TOPLEVEL`.
```ruby
TOPLEVEL = [1]
module M
def self.f
TOPLEVEL
end
end
Ractor.new { M.f }.value
```
This was because `rb_const_get_0()` built the "path" part referring to
the module/class passed to it in the first place. When a constant was
found through recursive search upwards, the module/class which the
constant was found should be reported.
This patch fixes this issue by modifying rb_const_search() to take a
VALUE pointer to be filled with the module/class where the constant was
found.
[Bug #21782]
Diffstat (limited to 'test/ruby/test_thread_queue.rb')
0 files changed, 0 insertions, 0 deletions
