mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Preserve the encoding of message from outer local variable
In the case of read-only but refering an unshareable object.
This commit is contained in:
parent
ec2e04c90d
commit
5e52fd4bd1
2 changed files with 5 additions and 1 deletions
|
@ -111,6 +111,10 @@ class TestISeq < Test::Unit::TestCase
|
|||
assert_raise_with_message(ArgumentError, /\(#{name}\)/) do
|
||||
Ractor.make_shareable(y)
|
||||
end
|
||||
y = eval("proc {#{name} = []; proc {|x| #{name}}}").call
|
||||
assert_raise_with_message(Ractor::IsolationError, /`#{name}'/) do
|
||||
Ractor.make_shareable(y)
|
||||
end
|
||||
end
|
||||
|
||||
def test_disasm_encoding
|
||||
|
|
2
vm.c
2
vm.c
|
@ -1037,7 +1037,7 @@ env_copy(const VALUE *src_ep, VALUE read_only_variables)
|
|||
if (!rb_ractor_shareable_p(v)) {
|
||||
rb_raise(rb_eRactorIsolationError,
|
||||
"can not make shareable Proc because it can refer unshareable object %"
|
||||
PRIsVALUE" from variable `%s'", rb_inspect(v), rb_id2name(id));
|
||||
"+" PRIsVALUE " from variable `%" PRIsVALUE "'", v, rb_id2str(id));
|
||||
}
|
||||
env_body[j] = v;
|
||||
rb_ary_delete_at(read_only_variables, i);
|
||||
|
|
Loading…
Add table
Reference in a new issue