diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-07 03:58:01 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-07 03:58:01 +0000 |
commit | a383ffa07b4641f6e19500e95cf9388af05e510c (patch) | |
tree | 971951b52ac3656d9eff316985b46011b10adcb4 /test | |
parent | d2d9d6ef1764f5e2f0b2ae0f6a96230b4332d67d (diff) |
merge revision(s) 45642,45643: [Backport #9646] [Backport #9729]
* st.c (st_foreach_check): chnage start point of search at check
from top to current. [ruby-dev:48047] [Bug #9646]
* st.c (st_foreach_check): change start point of search at check
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@46747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_hash.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index b545395780..cc7555fc5e 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -951,6 +951,17 @@ class TestHash < Test::Unit::TestCase assert_predicate(h.dup, :compare_by_identity?, bug8703) end + def test_same_key + bug9646 = '[ruby-dev:48047] [Bug #9646] Infinite loop at Hash#each' + h = @cls[a=[], 1] + a << 1 + h[[]] = 2 + a.clear + cnt = 0 + r = h.each{ break nil if (cnt+=1) > 100 } + assert_not_nil(r,bug9646) + end + class ObjWithHash def initialize(value, hash) @value = value |