diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-06 09:37:59 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-06 09:37:59 +0000 |
commit | 38e8e9b8125f25a2d2399f17b7d35c5d0d9a7d51 (patch) | |
tree | fbbcf7f86657a28dc66b8a7fc9f653009e575729 /test | |
parent | ac5e254cef04ed76c0a37d4a2442bc172c886652 (diff) | |
download | ruby-38e8e9b8125f25a2d2399f17b7d35c5d0d9a7d51.tar.gz |
vm_insnhelper.c: check symbol proc to throw
* vm_insnhelper.c (vm_throw_start): check if the iseq is symbol
proc, class definition should not be a symbol proc.
[ruby-core:75856] [Bug #12462]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_symbol.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb index 8bb9902317..03934226a1 100644 --- a/test/ruby/test_symbol.rb +++ b/test/ruby/test_symbol.rb @@ -157,6 +157,15 @@ class TestSymbol < Test::Unit::TestCase assert_equal(1, first, bug11594) end + private def return_from_proc + Proc.new { return 1 }.tap(&:call) + end + + def test_return_from_symbol_proc + bug12462 = '[ruby-core:75856] [Bug #12462]' + assert_equal(1, return_from_proc, bug12462) + end + def test_to_proc_for_hash_each bug11830 = '[ruby-core:72205] [Bug #11830]' assert_normal_exit(<<-'end;', bug11830) # do |