mirror of
https://github.com/ruby/ruby.git
synced 2025-09-20 02:53:57 +02:00
hash.c: restore iter_lev
* hash.c (hash_foreach_ensure): restore iter_lev to the previous value, not just decrement. [ruby-dev:47803] [Bug #9105] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b0af0592fd
commit
04c7fa0f3b
3 changed files with 28 additions and 5 deletions
|
@ -930,6 +930,22 @@ class TestHash < Test::Unit::TestCase
|
|||
h.clear
|
||||
c.call
|
||||
end
|
||||
|
||||
bug9105 = '[ruby-dev:47803] [Bug #9105]'
|
||||
h = @cls[1=>2, 3=>4]
|
||||
c = nil
|
||||
f = false
|
||||
h.each {callcc {|c2| c = c2}}
|
||||
unless f
|
||||
f = true
|
||||
c.call
|
||||
end
|
||||
assert_nothing_raised(RuntimeError, bug9105) do
|
||||
h.each {|i, j|
|
||||
h.delete(i);
|
||||
assert_not_equal(false, i, bug9105)
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
def test_compare_by_identity
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue