diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-19 15:29:01 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-19 15:29:01 +0000 |
commit | e4ff461d0f7266d860df0ec1152c185e99cf84b9 (patch) | |
tree | b444a4387f5e6152d589ae85bfe0758113dc5605 /test | |
parent | dab7362b04aadd7ba9aea1e129edaca08e16702c (diff) | |
download | ruby-e4ff461d0f7266d860df0ec1152c185e99cf84b9.tar.gz |
proc.c: fix infinite loop
* proc.c (rb_proc_get_iseq): proc made from symbol does not have
iseq. fix infinite loop. [ruby-core:72381] [Bug #11845]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_symbol.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb index 94541865f2..8960bec0d1 100644 --- a/test/ruby/test_symbol.rb +++ b/test/ruby/test_symbol.rb @@ -164,6 +164,18 @@ class TestSymbol < Test::Unit::TestCase end; end + def test_to_proc_iseq + assert_separately([], <<~"end;", timeout: 1) # do + bug11845 = '[ruby-core:72381] [Bug #11845]' + assert_nil(:class.to_proc.source_location, bug11845) + assert_equal([[:rest]], :class.to_proc.parameters, bug11845) + c = Class.new {define_method(:klass, :class.to_proc)} + m = c.instance_method(:klass) + assert_nil(m.source_location, bug11845) + assert_equal([[:rest]], m.parameters, bug11845) + end; + end + def test_call o = Object.new def o.foo(x, y); x + y; end |