summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/ruby/test_iseq.rb4
-rw-r--r--vm.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb
index af92edc494..34124ae966 100644
--- a/test/ruby/test_iseq.rb
+++ b/test/ruby/test_iseq.rb
@@ -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
diff --git a/vm.c b/vm.c
index 18725de5a4..8bf4db3c73 100644
--- a/vm.c
+++ b/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);