diff options
author | Jeremy Evans <[email protected]> | 2019-09-03 14:53:16 -0700 |
---|---|---|
committer | Jeremy Evans <[email protected]> | 2019-09-05 17:47:12 -0700 |
commit | 38dae1d510b931516ba1229a1ffbe5f6e470e292 (patch) | |
tree | a4d89f1611dc78473628917e55abed8407abc335 /vm_insnhelper.c | |
parent | 7fc874bf4cbdd87b3d6fe05dc5959175f3fe94b8 (diff) |
If removing an empty keyword splat hash, unset the kw_splat flag
Otherwise the last positional hash could be considered as the
keyword arguments.
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index de5a192e8b..7895c8a0eb 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -2192,6 +2192,7 @@ vm_call_cfunc_with_frame(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp if (UNLIKELY(calling->kw_splat)) { if (RHASH_EMPTY_P(*(GET_SP()-1))) { argc--; + calling->kw_splat = 0; } } if (UNLIKELY(IS_ARGS_KW_OR_KW_SPLAT(ci))) { @@ -2927,6 +2928,7 @@ vm_callee_setup_block_arg(rb_execution_context_t *ec, struct rb_calling_info *ca if (UNLIKELY(calling->kw_splat)) { if (RHASH_EMPTY_P(argv[calling->argc-1])) { calling->argc--; + calling->kw_splat = 0; } } |