diff options
Diffstat (limited to 'test/ruby/test_keyword.rb')
-rw-r--r-- | test/ruby/test_keyword.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb index c21afe4495..dd4f6d1b42 100644 --- a/test/ruby/test_keyword.rb +++ b/test/ruby/test_keyword.rb @@ -396,4 +396,23 @@ class TestKeywordArguments < Test::Unit::TestCase assert_equal([{}, {}], a.new.foo({})) assert_equal([{}, {:bar=>"x"}], a.new.foo({}, bar: "x")) end + + def test_gced_object_in_stack + bug8964 = '[ruby-dev:47729] [Bug #8964]' + assert_normal_exit %q{ + def m(a: []) + end + GC.stress = true + tap { m } + GC.start + tap { m } + }, bug8964 + assert_normal_exit %q{ + prc = Proc.new {|a: []|} + GC.stress = true + tap { prc.call } + GC.start + tap { prc.call } + }, bug8964 + end end |