Project

General

Profile

Bug #13298 » x64-mingw32-callcc-test.rb

Repro derived from `TestHash#test_callcc` in `test/ruby/test_hash.rb` - xtkoba (Tee KOBAYASHI), 06/04/2021 01:14 AM

 

require "continuation"

@cls ||= Hash
@h = @cls[
1 => 'one', 2 => 'two', 3 => 'three',
self => 'self', true => 'true', nil => 'nil',
'nil' => nil
]

h = @cls[1=>2]
c = nil
f = false
h.each { callcc {|c2| c = c2 } }
unless f
f = true
c.call
end
begin
h.each { h.rehash }
rescue RuntimeError
p :foo
end

h = @cls[1=>2]
c = nil

begin
h.each { callcc {|c2| c = c2 } }
h.clear
c.call
rescue RuntimeError
p :bar
end
(2-2/2)