summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-23 06:56:08 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-23 06:56:08 +0000
commite6ad53beaa8f61c784d7e6c9cace5bd6ecc4d5c8 (patch)
tree224599c7b347566e9d0050cb986052810b7df7cb /test
parentb32b2a61060a93babfa2f97cbc0a32be81b57dc0 (diff)
remove VM_ENV_DATA_INDEX_ENV_PROC.
* vm_core.h (VM_ENV_DATA_INDEX_ENV_PROC): ep[VM_ENV_DATA_INDEX_ENV_PROC] is allocated to mark a Proc which is created from iseq block. However, `lep[0]` keeps Proc object itself as a block handler (Proc). So we don't need to keep it. * vm_core.h (VM_ENV_PROCVAL): ditto. * vm.c (vm_make_env_each): do not need to keep blockprocval as special value. * vm.c (vm_block_handler_escape): simply return Proc value. * proc.c (proc_new): we don't need to check Env because a Proc type block handler is a Proc object itself. [Bug #14782] * test/ruby/test_proc.rb: add a test for [Bug #14782] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_proc.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb
index 2e4fd201c3..1f713f3dbc 100644
--- a/test/ruby/test_proc.rb
+++ b/test/ruby/test_proc.rb
@@ -1408,4 +1408,12 @@ class TestProc < Test::Unit::TestCase
m {}
end;
end
+
+ def method_for_test_proc_without_block_for_symbol
+ binding.eval('proc')
+ end
+
+ def test_proc_without_block_for_symbol
+ assert_equal('1', method_for_test_proc_without_block_for_symbol(&:to_s).call(1), '[Bug #14782]')
+ end
end