From c2e8fb0f34999739cff9c9e2d637346079b9365f Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 15 Oct 2015 04:37:26 +0000 Subject: proc.c: proc without env * proc.c (rb_sym_to_proc): move from string.c and create a Proc with no environments. [ruby-core:71088] [Bug #11594] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_symbol.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/ruby/test_symbol.rb') diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb index 1329ea22ab..07b75b0024 100644 --- a/test/ruby/test_symbol.rb +++ b/test/ruby/test_symbol.rb @@ -147,6 +147,14 @@ class TestSymbol < Test::Unit::TestCase end; end + def test_to_proc_call_with_symbol_proc + first = 1 + bug11594 = "[ruby-core:71088] [Bug #11594] corrupted the first local variable" + # symbol which does not have a Proc + ->(&blk) {}.call(&:test_to_proc_call_with_symbol_proc) + assert_equal(1, first, bug11594) + end + def test_call o = Object.new def o.foo(x, y); x + y; end -- cgit v1.2.3