diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-08 05:41:44 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-08 05:41:44 +0000 |
commit | 69b716111f04a5a692578638a16fc55a75a9dd1d (patch) | |
tree | c347b8f115c98bb87505a8d3a713ebcf711d253f /test/ruby | |
parent | bdb18e5ffad55f326c0fc3ea659fbe254f15b909 (diff) | |
download | ruby-69b716111f04a5a692578638a16fc55a75a9dd1d.tar.gz |
vm_core.h: flip_cnt in rb_iseq_t
* vm_core.h (rb_iseq_t): move flip_cnt from struct iseq_compile_data,
because it has same life span as enclosing iseq. [Bug #7671]
[ruby-core:51296]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_flip.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_flip.rb b/test/ruby/test_flip.rb index 8d7cdd03ad..bd14228a8c 100644 --- a/test/ruby/test_flip.rb +++ b/test/ruby/test_flip.rb @@ -10,4 +10,12 @@ class TestFlip < Test::Unit::TestCase 2000.times {eval %[(foo..bar) ? 1 : 2]} end end + + def test_shared_eval + bug7671 = '[ruby-core:51296]' + vs = (1..9).to_a + vs.select {|n| if n==2..n==16 then 1 end} + v = eval("vs.select {|n| if n==3..n==6 then 1 end}") + assert_equal([*3..6], v, bug7671) + end end |