diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-12 02:20:09 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-12 02:20:09 +0000 |
commit | 58889d77d226cb8f28b2d34cb4a31588d36fcd69 (patch) | |
tree | 574f960f6e3de1be9a6a2078264d65bf43555bc1 /test | |
parent | 0a68f881d10250f64e7e2c1e93bdd86ed1e4482a (diff) | |
download | ruby-58889d77d226cb8f28b2d34cb4a31588d36fcd69.tar.gz |
* proc.c (get_local_variable_ptr): return found env ptr. Returned env
will be used by write barrier at `bind_local_variable_set()'.
[Bug #13605]
* test/ruby/test_proc.rb: add a test for this issue.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_proc.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb index 3a0b707885..68455c1bcc 100644 --- a/test/ruby/test_proc.rb +++ b/test/ruby/test_proc.rb @@ -1324,6 +1324,20 @@ class TestProc < Test::Unit::TestCase assert_equal(20, b.eval("b")) end + def test_local_variable_set_wb + assert_ruby_status([], <<-'end;', '[Bug #13605]') + b = binding + n = 20_000 + + n.times do |i| + v = rand(2_000) + name = "n#{v}" + value = Object.new + b.local_variable_set name, value + end + end; + end + def test_local_variable_defined? b = get_binding assert_equal(true, b.local_variable_defined?(:a)) |