diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2021-09-23 16:27:05 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:41 -0400 |
commit | 8edb29e5a013da5a74fba9c2484bd6d3913bfb4b (patch) | |
tree | 14d37ff00962a6a2b95854b58ed856e3d914b729 /bootstraptest | |
parent | d0a213b30d04372d1a1b5012246ac7da3236db31 (diff) |
Reconstruct interpreter state before calling rb_ivar_get()
It could raise ractor exceptions. The included test didn't run properly
before this change.
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_yjit.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index 6d507e17d7..73b87e17fd 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -2018,3 +2018,23 @@ assert_normal_exit %q{ foo([1]) rescue nil foo([1]) rescue nil } + +# test ractor exception on when getting ivar +assert_equal '42', %q{ + class A + def self.foo + _foo = 1 + _bar = 2 + begin + @bar + rescue Ractor::IsolationError + 42 + end + end + end + + A.foo + A.foo + + Ractor.new { A.foo }.take +} |