aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_symbol.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-19 15:29:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-19 15:29:01 +0000
commit2d97cee4d57b4f6bc1358c63d8ffd99047e4965e (patch)
treeb444a4387f5e6152d589ae85bfe0758113dc5605 /test/ruby/test_symbol.rb
parentea46a6408c15c26e80ceb0a6cdf64be15a8fe03f (diff)
downloadruby-2d97cee4d57b4f6bc1358c63d8ffd99047e4965e.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/ruby/test_symbol.rb')
-rw-r--r--test/ruby/test_symbol.rb12
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