ruby-changes:18658
From: kosaki <ko1@a...>
Date: Fri, 28 Jan 2011 02:36:41 +0900 (JST)
Subject: [ruby-changes:18658] Ruby:r30683 (trunk): * hash.c (rb_hash_fetch_m): add GC guard to prevent intermediate
kosaki 2011-01-28 02:36:32 +0900 (Fri, 28 Jan 2011) New Revision: 30683 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30683 Log: * hash.c (rb_hash_fetch_m): add GC guard to prevent intermediate variable from GC. Modified files: trunk/ChangeLog trunk/hash.c Index: ChangeLog =================================================================== --- ChangeLog (revision 30682) +++ ChangeLog (revision 30683) @@ -1,3 +1,8 @@ +Fri Jan 28 02:35:41 2011 KOSAKI Motohiro <kosaki.motohiro@g...> + + * hash.c (rb_hash_fetch_m): add GC guard to prevent intermediate + variable from GC. + Fri Jan 28 01:33:51 2011 KOSAKI Motohiro <kosaki.motohiro@g...> * test/ruby/test_process.rb (TestProcess#test_too_long_path) Index: hash.c =================================================================== --- hash.c (revision 30682) +++ hash.c (revision 30683) @@ -583,7 +583,7 @@ if (!RHASH(hash)->ntbl || !st_lookup(RHASH(hash)->ntbl, key, &val)) { if (block_given) return rb_yield(key); if (argc == 1) { - VALUE desc = rb_protect(rb_inspect, key, 0); + volatile VALUE desc = rb_protect(rb_inspect, key, 0); if (NIL_P(desc) || RSTRING_LEN(desc) > 65) { desc = rb_any_to_s(key); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/