summaryrefslogtreecommitdiff
path: root/vm_args.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_args.c')
-rw-r--r--vm_args.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/vm_args.c b/vm_args.c
index 7bf61cefe7..1efb84a0a3 100644
--- a/vm_args.c
+++ b/vm_args.c
@@ -821,6 +821,10 @@ setup_parameters_complex(rb_execution_context_t * const ec, const rb_iseq_t * co
kw_flag &= ~VM_CALL_KW_SPLAT;
}
else {
+ if (RB_TYPE_P(rest_last, T_HASH) && rb_obj_frozen_p(rest_last)) {
+ rest_last = rb_hash_new();
+ RARRAY_ASET(args->rest, len - 1, rest_last);
+ }
flag_keyword_hash = rest_last;
}
}
@@ -844,6 +848,10 @@ setup_parameters_complex(rb_execution_context_t * const ec, const rb_iseq_t * co
kw_flag &= ~VM_CALL_KW_SPLAT;
}
else {
+ if (RB_TYPE_P(last_arg, T_HASH) && rb_obj_frozen_p(last_arg)) {
+ last_arg = rb_hash_new();
+ args->argv[args->argc-1] = last_arg;
+ }
flag_keyword_hash = last_arg;
}
}