diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-12-28 01:38:17 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-12-28 01:52:18 +0900 |
commit | c8010fcec016ee89aa0c45fe31094b2db0023e5c (patch) | |
tree | 3b3a20a8fca8968ee07f6094b666162d748eaae2 /compile.c | |
parent | cc055d4d3fc4a3999766b17a2c9f7cd968be1118 (diff) |
Dup kwrest hash when merging other keyword arguments [Bug #17481]
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -8157,6 +8157,10 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in if (local_body->param.flags.has_kwrest) { int idx = local_body->local_table_size - local_kwd->rest_start; ADD_GETLOCAL(args, line, idx, lvar_level); + if (local_kwd->num > 0) { + ADD_SEND(args, line, rb_intern("dup"), INT2FIX(0)); + flag |= VM_CALL_KW_SPLAT_MUT; + } } else { ADD_INSN1(args, line, newhash, INT2FIX(0)); |