summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootstraptest/test_method.rb21
-rw-r--r--vm_args.c2
2 files changed, 22 insertions, 1 deletions
diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb
index af9443b8c6..f6f04541d6 100644
--- a/bootstraptest/test_method.rb
+++ b/bootstraptest/test_method.rb
@@ -1374,3 +1374,24 @@ assert_equal 'ok', %q{
foo(:foo, b: :ok)
foo(*["foo"], b: :ok)
}
+
+assert_equal 'ok', %q{
+ Thing = Struct.new(:value)
+
+ Obj = Thing.new("ok")
+
+ def delegate(...)
+ Obj.value(...)
+ end
+
+ def no_args
+ delegate
+ end
+
+ def splat_args(*args)
+ delegate(*args)
+ end
+
+ no_args
+ splat_args
+}
diff --git a/vm_args.c b/vm_args.c
index 0ecdc31a31..28f685d7dd 100644
--- a/vm_args.c
+++ b/vm_args.c
@@ -1177,7 +1177,7 @@ vm_caller_setup_fwd_args(const rb_execution_context_t *ec, rb_control_frame_t *r
*adjusted_ci = VM_CI_ON_STACK(
site_mid,
- (caller_flag | (site_flag & (VM_CALL_FCALL | VM_CALL_FORWARDING))),
+ ((caller_flag & ~VM_CALL_ARGS_SIMPLE) | (site_flag & (VM_CALL_FCALL | VM_CALL_FORWARDING))),
site_argc + caller_argc,
kw
);