aboutsummaryrefslogtreecommitdiffstats
path: root/bootstraptest
diff options
context:
space:
mode:
authorJimmy Miller <jimmy.miller@shopify.com>2023-03-21 12:57:26 -0400
committerGitHub <noreply@github.com>2023-03-21 12:57:26 -0400
commit5de26bc0319d8b0de315cb90e68345a816673fa6 (patch)
treeeaa139a38a1d1b24c96dc2fa92f781abda41ffb7 /bootstraptest
parentf62fa5128301f07352b215ef118fa5264800ad0b (diff)
downloadruby-5de26bc0319d8b0de315cb90e68345a816673fa6.tar.gz
YJIT: Fix incorrect exit in splat (#7575)
So by itself, this shouldn't have been a correctness issue, but we also pop the stack for block_args. Doing stack manipulation like that and then side-exiting causes issues. So, while this fixes the immediate failure, we have a bigger issue with block_args popping and then exiting that we need to deal with.
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_yjit.rb15
1 files changed, 15 insertions, 0 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")
+}