From cb8a040b7906c09d9d3ac3d3fe853f633005024f Mon Sep 17 00:00:00 2001 From: Jimmy Miller Date: Wed, 1 Mar 2023 16:33:16 -0500 Subject: YJIT: Properly deal with cfunc splat when no args needed (#7413) Related to: https://github.com/ruby/ruby/pull/7377 Previously it was believed that there was a problem with a combination of cfuncs + splat + send, but it turns out the same issue happened without send. For example `Integer.sqrt(1, *[])`. The issue was happened not because of send, but because of setting the wrong argc when we don't need to splat any args. --- bootstraptest/test_yjit.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bootstraptest') diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index 68b738477b..568cc583b1 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -3584,3 +3584,13 @@ assert_equal 'true', %q{ assert_equal 'true', %q{ 1.send(:==, 1, *[]) } + +# Test send with splat to a cfunc +assert_equal '2', %q{ + def foo + Integer.sqrt(4, *[]) + end + # call twice to deal with constant exiting + foo + foo +} -- cgit v1.2.1