diff options
author | Luke Gruber <[email protected]> | 2025-05-23 11:12:14 -0400 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2025-05-23 21:13:23 +0200 |
commit | f64c89f18d3a0cd15ea334d43f73f72e7bd99140 (patch) | |
tree | 5cf4aabd85183cd3c7a3217ed2d1dedc2364a02a /ractor.c | |
parent | b7e751181eefbce272958d62c26e396ac16363c1 (diff) |
Fix 'require' from a ractor when the required file raises an error
If you catch an error that was raised from a file you required in
a ractor, that error did not have its belonging reset from the main
ractor to the current ractor, so you hit assertion errors in debug
mode.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13428
Diffstat (limited to 'ractor.c')
-rw-r--r-- | ractor.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -4217,9 +4217,12 @@ rb_ractor_require(VALUE feature) rb_ractor_channel_close(ec, crr.ch); if (crr.exception != Qundef) { + ractor_reset_belonging(crr.exception); rb_exc_raise(crr.exception); } else { + RUBY_ASSERT(crr.result != Qundef); + ractor_reset_belonging(crr.result); return crr.result; } } |