aboutsummaryrefslogtreecommitdiffstats
path: root/vm_args.c
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2019-09-05 12:28:36 +0900
committerJeremy Evans <code@jeremyevans.net>2019-09-05 17:47:12 -0700
commit030b8e5edf1056e59c37bc52ed6f4deca7e8ac41 (patch)
tree0bdc37e99ac2ca64cf9f29ad4475320e882a2922 /vm_args.c
parent1fffd33189ddb4dfdefe2ada09ec884f89e305ce (diff)
downloadruby-030b8e5edf1056e59c37bc52ed6f4deca7e8ac41.tar.gz
Set calling->kw_splat = 1 in vm_caller_setup_arg_kw
There are two styles that argv contains keyword arguments: one is VM_CALL_KWARG which contains value elements in argv (to avoid a hash object creation if possible), and the other is VM_CALL_KW_SPLAT which contains one last hash in argv. vm_caller_setup_arg_kw translates argv from the VM_CALL_KWARG style to the VM_CALL_KW_SPLAT style. `calling->kw_splat` means that argv is the VM_CALL_KW_SPLAT style. So, instead of setting `calling->kw_splat` at many places, it would be better to do so when vm_caller_setup_arg_kw is called.
Diffstat (limited to 'vm_args.c')
-rw-r--r--vm_args.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/vm_args.c b/vm_args.c
index a80100ea3c..add5dd5c6f 100644
--- a/vm_args.c
+++ b/vm_args.c
@@ -985,6 +985,7 @@ vm_caller_setup_arg_kw(rb_control_frame_t *cfp, struct rb_calling_info *calling,
cfp->sp -= kw_len - 1;
calling->argc -= kw_len - 1;
+ calling->kw_splat = 1;
}
static VALUE