summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-16 15:59:16 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-16 15:59:16 +0000
commit5a2f6a4af8a4b1082207979e2913c681ad6ea1bb (patch)
treebb4eb2fa18aa181fa578499312cfec474f929251 /compile.c
parent12285fc1094bcbe290a8a12555f175c1eb41c88d (diff)
merge revision(s) r45724: [Backport #9776]
* compile.c (compile_array_): make copy a first hash not to modify the argument itself. keyword splat should be non-destructive. [ruby-core:62161] [Bug #9776] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index e96a9829d4..52656dca8c 100644
--- a/compile.c
+++ b/compile.c
@@ -2479,6 +2479,7 @@ compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
if (i > 0 || !first) ADD_INSN(ret, line, swap);
COMPILE(ret, "keyword splat", kw);
ADD_SEND(ret, line, ID2SYM(id_core_hash_merge_kwd), nhash);
+ if (nhash == INT2FIX(1)) ADD_SEND(ret, line, ID2SYM(rb_intern("dup")), INT2FIX(0));
}
first = 0;
break;