ruby/ruby-3.3.12-Allow-up-to-1-send-from-exits-YJIT-stat-for-proc-tes.patch
2026-08-05 09:10:07 -04:00

33 lines
1.3 KiB
Diff

From feee246753aa097e836a79ea8437f4b8c73df7e8 Mon Sep 17 00:00:00 2001
From: Jarek Prokop <jprokop@redhat.com>
Date: Tue, 21 Jul 2026 10:32:29 +0200
Subject: [PATCH] Allow up to 1 send from exits YJIT stat for proc test.
Add an allowed range of 0..1 for exits send stat.
In some case, the stats contain extra stat under 'exits' for 'send'.
In any other case, the stat is 0, and test passes.
From RPM build of Ruby for Fedora distro family, the exits' stats emit 1 extra send.
The commit that introduced fix and the offending test
0cba8cf414dfd8ab30edc3081645405c165a81d5 for [Bug #21266]
prevents a crash, which seems prevented here as well.
---
test/ruby/test_yjit.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb
index 0d40d38872..df1b41aa16 100644
--- a/test/ruby/test_yjit.rb
+++ b/test/ruby/test_yjit.rb
@@ -1528,7 +1528,7 @@ def test_disable_stats
def test_proc_block_with_kwrest
# When the bug was present this required --yjit-stats to trigger.
- assert_compiles(<<~RUBY, result: {extra: 5})
+ assert_compiles(<<~RUBY, result: {extra: 5}, exits: {send: 0..1})
def foo = bar(w: 1, x: 2, y: 3, z: 4, extra: 5, &proc { _1 })
def bar(w:, x:, y:, z:, **kwrest) = yield kwrest