diff options
| -rw-r--r-- | test/ruby/test_yjit.rb | 16 | ||||
| -rw-r--r-- | version.h | 2 | ||||
| -rw-r--r-- | yjit_codegen.c | 2 |
3 files changed, 19 insertions, 1 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb index 6390ab4c01..d65ffb3d97 100644 --- a/test/ruby/test_yjit.rb +++ b/test/ruby/test_yjit.rb @@ -684,4 +684,20 @@ class TestYJIT < Test::Unit::TestCase stats_r.close [status, out, err, stats] end + + def test_bug_19316 + n = 2 ** 64 + # foo's extra param and the splats are relevant + assert_compiles(<<~'RUBY', result: [[n, -n], [n, -n]]) + def foo(_, a, b, c) + [a & b, ~c] + end + + n = 2 ** 64 + args = [0, -n, n, n-1] + + GC.stress = true + [foo(*args), foo(*args)] + RUBY + end end @@ -11,7 +11,7 @@ # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR #define RUBY_VERSION_TEENY 4 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 196 +#define RUBY_PATCHLEVEL 197 #define RUBY_RELEASE_YEAR 2023 #define RUBY_RELEASE_MONTH 3 diff --git a/yjit_codegen.c b/yjit_codegen.c index 21e4813c19..7b333b9096 100644 --- a/yjit_codegen.c +++ b/yjit_codegen.c @@ -3638,6 +3638,8 @@ gen_send_iseq(jitstate_t *jit, ctx_t *ctx, const struct rb_callinfo *ci, const r if (leaf_builtin && !block && leaf_builtin->argc + 1 <= NUM_C_ARG_REGS) { ADD_COMMENT(cb, "inlined leaf builtin"); + jit_prepare_routine_call(jit, ctx, REG0); + // Call the builtin func (ec, recv, arg1, arg2, ...) mov(cb, C_ARG_REGS[0], REG_EC); |
