summaryrefslogtreecommitdiff
path: root/test/ruby/test_eval.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_eval.rb')
-rw-r--r--test/ruby/test_eval.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_eval.rb b/test/ruby/test_eval.rb
index 8e7416b333..af24ee1361 100644
--- a/test/ruby/test_eval.rb
+++ b/test/ruby/test_eval.rb
@@ -483,4 +483,19 @@ class TestEval < Test::Unit::TestCase
fname = "\u{3042}".encode("euc-jp")
assert_equal(fname, eval("__FILE__", nil, fname, 1))
end
+
+ def test_gced_binding_block
+ assert_normal_exit %q{
+ def m
+ binding
+ end
+ GC.stress = true
+ b = nil
+ tap do
+ b = m {}
+ end
+ 0.times.to_a
+ b.eval('yield')
+ }, '[Bug #10368]'
+ end
end