From 2e0f3b5546854c98174d4210c0e06c78c8294f98 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 30 Jan 2023 11:16:33 -0800 Subject: YJIT: Fix BorrowMutError on GC.compact (#7176) YJIT: Fix BorrowMutError --- test/ruby/test_yjit.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/ruby') 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 -- cgit v1.2.3