summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2024-01-18 19:26:03 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2024-01-18 20:22:40 -0500
commitbbd249e351af7e4929b518a5de73a832b5617273 (patch)
tree26a9972c8182e06a8940ad1c592185ddc2a1e226 /bootstraptest
parent61da90c1b8d5c9a62d429ef66f000117eca675b3 (diff)
YJIT: Properly reject keyword splat with `yield`
We don't have support for keyword splat anywhere, but we tried to compile these anyways in case of `invokeblock`. This led to bad things happening such as passing the wrong value and passing a hash into rb_yjit_array_len(), which raised in the middle of compilation. [Bug #20192]
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_yjit.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb
index 5b53e8089b..a6b0f8f19c 100644
--- a/bootstraptest/test_yjit.rb
+++ b/bootstraptest/test_yjit.rb
@@ -11,6 +11,13 @@ assert_normal_exit %q{
call_foo
}
+# regression test for keyword splat with yield
+assert_equal 'nil', %q{
+ def splat_kw(kwargs) = yield(**kwargs)
+
+ splat_kw({}) { _1 }.inspect
+}
+
# regression test for arity check with splat
assert_equal '[:ae, :ae]', %q{
def req_one(a_, b_ = 1) = raise