diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-01-30 11:16:33 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-30 11:16:33 -0800 |
commit | 2e0f3b5546854c98174d4210c0e06c78c8294f98 (patch) | |
tree | 3f17dcab5b759e5a45b10415a2ce368ff1dcaa20 /test/ruby | |
parent | bc0dc9d40e20cd3d0a1dd0b3fae061aae34d5a33 (diff) |
YJIT: Fix BorrowMutError on GC.compact (#7176)
YJIT: Fix BorrowMutError
Notes
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_yjit.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb index 6b6ea6619e..d390a19cbc 100644 --- a/test/ruby/test_yjit.rb +++ b/test/ruby/test_yjit.rb @@ -1058,6 +1058,22 @@ class TestYJIT < Test::Unit::TestCase RUBY end + def test_gc_compact_cyclic_branch + assert_compiles(<<~'RUBY', result: 2) + def foo + i = 0 + while i < 2 + i += 1 + end + i + end + + foo + GC.compact + foo + RUBY + end + private def code_gc_helpers |