summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-01-31 12:26:56 -0800
committerGitHub <noreply@github.com>2023-01-31 15:26:56 -0500
commite11067ebbfcf2c2422a5d00b50306782a9d86364 (patch)
treecc533fd02e574b63364459cd822e56ed248b8bdc /test
parenteac5ae22e26e741b465527ab65017fda8890b6bf (diff)
YJIT: Fix BorrowMutError on BOP invalidation (#7212)
Notes
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_yjit.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb
index d390a19cbc..6627a78628 100644
--- a/test/ruby/test_yjit.rb
+++ b/test/ruby/test_yjit.rb
@@ -1074,6 +1074,24 @@ class TestYJIT < Test::Unit::TestCase
RUBY
end
+ def test_invalidate_cyclic_branch
+ assert_compiles(<<~'RUBY', result: 2)
+ def foo
+ i = 0
+ while i < 2
+ i += 1
+ end
+ i
+ end
+
+ foo
+ class Integer
+ def +(x) = self - -x
+ end
+ foo
+ RUBY
+ end
+
private
def code_gc_helpers