diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2019-09-05 12:28:36 +0900 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2019-09-05 17:47:12 -0700 |
commit | 030b8e5edf1056e59c37bc52ed6f4deca7e8ac41 (patch) | |
tree | 0bdc37e99ac2ca64cf9f29ad4475320e882a2922 /vm_args.c | |
parent | 1fffd33189ddb4dfdefe2ada09ec884f89e305ce (diff) |
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.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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 |