summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorJimmy Miller <jimmy.miller@shopify.com>2023-03-01 16:33:16 -0500
committerGitHub <noreply@github.com>2023-03-01 16:33:16 -0500
commitcb8a040b7906c09d9d3ac3d3fe853f633005024f (patch)
treefee2b55370711f58478082960a5d7793413c8380 /bootstraptest
parenta80906a7147c6e67e5f6c15c2e414126b019b8d6 (diff)
downloadruby-cb8a040b7906c09d9d3ac3d3fe853f633005024f.tar.gz
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.
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_yjit.rb10
1 files changed, 10 insertions, 0 deletions
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
+}