diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-27 17:36:32 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-27 17:36:32 +0000 |
commit | 1e60af4d6779e739d205ef63f05ebfd3fb2f7223 (patch) | |
tree | c959f57c221dca069f17277392e46d1bae23c264 | |
parent | 41bbb319ddf1fad6b79c79107d3a865bc859b971 (diff) | |
download | ruby-1e60af4d6779e739d205ef63f05ebfd3fb2f7223.tar.gz |
* hash.c (rb_hash_fetch_m): add GC guard to prevent intermediate
variable from GC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | hash.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Fri Jan 28 02:35:41 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> + + * 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@gmail.com> * test/ruby/test_process.rb (TestProcess#test_too_long_path) @@ -583,7 +583,7 @@ rb_hash_fetch_m(int argc, VALUE *argv, VALUE hash) 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); } |