diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-10 06:11:16 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-10 06:11:16 +0000 |
commit | c9b4b78085ee07fa6cae4a267fa5dff80d6351a4 (patch) | |
tree | 402919e6009d329366415466247888ea44af3aa4 /test/ruby/test_flip.rb | |
parent | 2ffc29e8644f2aff66f373573299b33618b145f7 (diff) |
compile.c, vm_insnhelper.c: flip-flop without hidden string key
* compile.c (iseq_compile_each): count flip-flop state in local iseq
not in each iseqs, so that the keys can be other than hidden
strings. [ruby-core:47253] [Bug #6899]
* vm_insnhelper.c (lep_svar_get, lep_svar_set, vm_getspecial): store
flip-flop states in an array instead of a hash.
* iseq.c (set_relation): main iseq also can has local scope.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_flip.rb')
-rw-r--r-- | test/ruby/test_flip.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_flip.rb b/test/ruby/test_flip.rb new file mode 100644 index 0000000000..8d7cdd03ad --- /dev/null +++ b/test/ruby/test_flip.rb @@ -0,0 +1,13 @@ +require 'test/unit' +require_relative 'envutil' + +class TestFlip < Test::Unit::TestCase + def test_hidden_key + bug6899 = '[ruby-core:47253]' + foo = "foor" + bar = "bar" + assert_nothing_raised(NotImplementedError, bug6899) do + 2000.times {eval %[(foo..bar) ? 1 : 2]} + end + end +end |