Respect encoding of ID in exception messages

This commit is contained in:
Daisuke Aritomo 2025-12-16 15:15:28 +09:00 committed by John Hawthorn
parent cbcbbb2fbe
commit 0fe111caa6
Notes: git 2025-12-17 01:16:28 +00:00
2 changed files with 2 additions and 3 deletions

View File

@ -3357,7 +3357,7 @@ rb_const_get_0(VALUE klass, ID id, int exclude, int recurse, int visibility)
if (!UNDEF_P(c)) {
if (UNLIKELY(!rb_ractor_main_p())) {
if (!rb_ractor_shareable_p(c)) {
rb_raise(rb_eRactorIsolationError, "can not access non-shareable objects in constant %"PRIsVALUE"::%s by non-main Ractor.", rb_class_path(found_in), rb_id2name(id));
rb_raise(rb_eRactorIsolationError, "can not access non-shareable objects in constant %"PRIsVALUE"::%"PRIsVALUE" by non-main Ractor.", rb_class_path(found_in), rb_id2str(id));
}
}
return c;

View File

@ -1145,7 +1145,7 @@ vm_get_ev_const(rb_execution_context_t *ec, VALUE orig_klass, ID id, bool allow_
if (UNLIKELY(!rb_ractor_main_p())) {
if (!rb_ractor_shareable_p(val)) {
rb_raise(rb_eRactorIsolationError,
"can not access non-shareable objects in constant %"PRIsVALUE"::%s by non-main ractor.", rb_class_path(klass), rb_id2name(id));
"can not access non-shareable objects in constant %"PRIsVALUE"::%"PRIsVALUE" by non-main ractor.", rb_class_path(klass), rb_id2str(id));
}
}
return val;
@ -7575,4 +7575,3 @@ rb_vm_lvar_exposed(rb_execution_context_t *ec, int index)
const rb_control_frame_t *cfp = ec->cfp;
return cfp->ep[index];
}