summaryrefslogtreecommitdiff
path: root/test/ruby/bug-11928.rb
blob: 72b3b0f8edfbe4af0206476d9c324fc82478365e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Segfault
  at_exit { Segfault.new.segfault }

  define_method 'segfault' do
    n = 11928
    v = nil
    i = 0
    while i < n
      i += 1
      v = (foo rescue $!).local_variables
    end
    assert_equal(%i[i n v], v.sort)
  end
end