From ba6a2717f48ee86df4dbf04f213c98e691a1964d Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 22 Jul 2025 09:56:47 +0900 Subject: [PATCH 1/3] Skip test_ln_sr(FileUtilsSingletonTest) ib rbs tests https://github.com/ruby/fileutils/pull/139 https://github.com/ruby/actions/actions/runs/16425309325/job/46414287784 --- tool/rbs_skip_tests | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tool/rbs_skip_tests b/tool/rbs_skip_tests index e8a10cf1459fee..6de4cce6e74e87 100644 --- a/tool/rbs_skip_tests +++ b/tool/rbs_skip_tests @@ -79,3 +79,6 @@ CGISingletonTest CGI is retired RactorSingletonTest Ractor API was changed https://bugs.ruby-lang.org/issues/21262 RactorInstanceTest Ractor API was changed https://bugs.ruby-lang.org/issues/21262 +# https://github.com/ruby/fileutils/pull/139 +# https://github.com/ruby/actions/actions/runs/16425309325/job/46414287784 +test_ln_sr(FileUtilsSingletonTest) From 9f961a4b309cd2ac1b58e1c5633b8a744e042f3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Thu, 17 Jul 2025 14:53:42 +0200 Subject: [PATCH 2/3] [rubygems/rubygems] Workaround RVM issue when using Bundler <= 2.5.22 Old versions of BUndler need a workaround to support nested `bundle exec` invocations by overriding `Gem.activate_bin_path`. However, RubyGems now uses this new `Gem.activate_and_load_bin_path` helper in binstubs, which is of course not overridden in those Bundler versions since it didn't exist at the time. So, include the override here to workaround that. https://github.com/rubygems/rubygems/commit/e5ed95e242 --- lib/rubygems.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/rubygems.rb b/lib/rubygems.rb index e4eca64fe14981..0c40f8482f38d0 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -298,6 +298,13 @@ def self.activate_and_load_bin_path(name, exec_name = nil, *requirements) spec = find_and_activate_spec_for_exe name, exec_name, requirements if spec.name == "bundler" + # Old versions of Bundler need a workaround to support nested `bundle + # exec` invocations by overriding `Gem.activate_bin_path`. However, + # RubyGems now uses this new `Gem.activate_and_load_bin_path` helper in + # binstubs, which is of course not overridden in Bundler since it didn't + # exist at the time. So, include the override here to workaround that. + load ENV["BUNDLE_BIN_PATH"] if ENV["BUNDLE_BIN_PATH"] && spec.version <= "2.5.22" + # Make sure there's no version of Bundler in `$LOAD_PATH` that's different # from the version we just activated. If that was the case (it happens # when testing Bundler from ruby/ruby), we would load Bundler extensions From e77eee96a3bd4ba737f6aee01acaffe795d7be60 Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Fri, 18 Jul 2025 14:30:58 -0400 Subject: [PATCH 3/3] ZJIT: Load return value before frame teardown Or else the following returns garbage since it loads after moving SP. Prior bad disassembly: def a(n1,n2,n3,n4,n5,n6,n7,n8) = n8 a(1,1,1,1,1,1,1,0) # Block: bb0(v0, v1, v2, v3, v4, v5, v6, v7, v8) stp x29, x30, [sp, #-0x10]! mov x29, sp # bump C stack pointer sub sp, sp, #0x10 # Insn: v10 Return v8 # pop stack frame adds x19, x19, #0x38 stur x19, [x20, #0x10] # restore C stack pointer add sp, sp, #0x10 mov sp, x29 ldp x29, x30, [sp], #0x10 ldur x0, [sp] ret --- test/ruby/test_zjit.rb | 5 +++++ zjit/src/codegen.rs | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb index 1166533bd9e8b0..69c440f5f08fba 100644 --- a/test/ruby/test_zjit.rb +++ b/test/ruby/test_zjit.rb @@ -806,6 +806,11 @@ def test def a(n1,n2,n3,n4,n5,n6,n7,n8,n9) = n1+n9 a(2,0,0,0,0,0,0,0,-1) } + + assert_compiles '0', %q{ + def a(n1,n2,n3,n4,n5,n6,n7,n8) = n8 + a(1,1,1,1,1,1,1,0) + } end def test_opt_aref_with diff --git a/zjit/src/codegen.rs b/zjit/src/codegen.rs index 6ce39159784b04..54346e077806c4 100644 --- a/zjit/src/codegen.rs +++ b/zjit/src/codegen.rs @@ -898,6 +898,10 @@ fn gen_return(jit: &JITState, asm: &mut Assembler, val: lir::Opnd) -> Option<()> asm.mov(CFP, incr_cfp); asm.mov(Opnd::mem(64, EC, RUBY_OFFSET_EC_CFP), CFP); + // Order here is important. Because we're about to tear down the frame, + // we need to load the return value, which might be part of the frame. + asm.load_into(C_RET_OPND, val); + // Restore the C stack pointer bumped for basic block arguments if jit.c_stack_bytes > 0 { asm_comment!(asm, "restore C stack pointer"); @@ -908,7 +912,7 @@ fn gen_return(jit: &JITState, asm: &mut Assembler, val: lir::Opnd) -> Option<()> asm.frame_teardown(); // Return from the function - asm.cret(val); + asm.cret(C_RET_OPND); Some(()) }