diff options
-rw-r--r-- | bootstraptest/test_yjit.rb | 15 | ||||
-rw-r--r-- | yjit/src/codegen.rs | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index 8902cd6cde..cab905a2af 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -3662,3 +3662,18 @@ assert_equal '[1, 2, 3]', %q{ end send(:bar, 1, 2, 3) } + +# Fix splat block arg bad compilation +assert_equal "foo", %q{ + def literal(*args, &block) + s = ''.dup + literal_append(s, *args, &block) + s + end + + def literal_append(sql, v) + sql << v + end + + literal("foo") +} diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index d0fd439264..824415346e 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -5708,7 +5708,7 @@ fn gen_send_iseq( unsafe { rb_yjit_array_len(array) as u32} }; - if opt_num == 0 && required_num != array_length as i32 { + if opt_num == 0 && required_num != array_length as i32 + argc - 1 { gen_counter_incr!(asm, send_iseq_splat_arity_error); return CantCompile; } |