summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-18 21:30:42 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-18 21:30:42 +0000
commit5a70af1d59b85c4987330b5ff8e3ef1cbb6e5668 (patch)
treec45b1a5380592de862131b4e43a331500976acfa /vm.c
parent0f1df31bdf1952065f75fa2bfaf32dbd14ec7525 (diff)
* vm.c (kwmerge_i): add WB.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/vm.c b/vm.c
index 69b4163..fe5f080 100644
--- a/vm.c
+++ b/vm.c
@@ -2174,7 +2174,9 @@ static int
kwmerge_i(VALUE key, VALUE value, VALUE hash)
{
if (!SYMBOL_P(key)) Check_Type(key, T_SYMBOL);
- st_update(RHASH_TBL(hash), key, kwmerge_ii, (st_data_t)value);
+ if (st_update(RHASH_TBL(hash), key, kwmerge_ii, (st_data_t)value) == 0) { /* !existing */
+ OBJ_WRITTEN(hash, Qundef, value);
+ }
return ST_CONTINUE;
}