summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-03 19:08:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-03 19:08:40 +0000
commit140929d8ba0e184a5c84ff6aa9c77ed5832eef68 (patch)
tree8a9557a97ff138622659e7d2c7f3f861d71e169a /vm.c
parentfc3c52eb37b145ebce2710c2cbf7662fcf0e378f (diff)
vm.c: return the result hash
* vm.c (core_hash_merge_kwd): should return the result hash, which may be converted from and differ from the given argument. [ruby-core:62921] [Bug #9898] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index ea138cc8..52e1f07 100644
--- a/vm.c
+++ b/vm.c
@@ -2357,6 +2357,7 @@ core_hash_merge_kwd(int argc, VALUE *argv)
hash = argv[0];
kw = argv[argc-1];
kw = rb_convert_type(kw, T_HASH, "Hash", "to_hash");
+ if (argc < 2) hash = kw;
rb_hash_foreach(kw, argc < 2 ? kwcheck_i : kwmerge_i, hash);
return hash;
}