[前][次][番号順一覧][スレッド一覧]

ruby-changes:29347

From: ko1 <ko1@a...>
Date: Wed, 19 Jun 2013 06:30:54 +0900 (JST)
Subject: [ruby-changes:29347] ko1:r41399 (trunk): * vm.c (kwmerge_i): add WB.

ko1	2013-06-19 06:30:42 +0900 (Wed, 19 Jun 2013)

  New Revision: 41399

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41399

  Log:
    * vm.c (kwmerge_i): add WB.

  Modified files:
    trunk/ChangeLog
    trunk/vm.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41398)
+++ ChangeLog	(revision 41399)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jun 19 06:29:31 2013  Koichi Sasada  <ko1@a...>
+
+	* vm.c (kwmerge_i): add WB.
+
 Wed Jun 19 06:26:49 2013  Koichi Sasada  <ko1@a...>
 
 	* hash.c: `st_update()' also has same issue of last fix.
Index: vm.c
===================================================================
--- vm.c	(revision 41398)
+++ vm.c	(revision 41399)
@@ -2174,7 +2174,9 @@ static int https://github.com/ruby/ruby/blob/trunk/vm.c#L2174
 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;
 }
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]