summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/ruby/test_symbol.rb6
-rw-r--r--version.h2
-rw-r--r--vm_eval.c3
3 files changed, 9 insertions, 2 deletions
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb
index 4461e51d61..636ec0a6a9 100644
--- a/test/ruby/test_symbol.rb
+++ b/test/ruby/test_symbol.rb
@@ -194,6 +194,12 @@ class TestSymbol < Test::Unit::TestCase
end;
end
+ def test_to_proc_instance_exec
+ bug = '[ruby-core:78839] [Bug #13074] should evaluate on the argument'
+ assert_equal(2, BasicObject.new.instance_exec(1, &:succ), bug)
+ assert_equal(3, BasicObject.new.instance_exec(1, 2, &:+), bug)
+ end
+
def test_call
o = Object.new
def o.foo(x, y); x + y; end
diff --git a/version.h b/version.h
index 2297747a00..2e2d074a4e 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.4.0"
#define RUBY_RELEASE_DATE "2017-03-11"
-#define RUBY_PATCHLEVEL 4
+#define RUBY_PATCHLEVEL 5
#define RUBY_RELEASE_YEAR 2017
#define RUBY_RELEASE_MONTH 3
diff --git a/vm_eval.c b/vm_eval.c
index c08a849e59..721ea00700 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1591,7 +1591,8 @@ yield_under(VALUE under, VALUE self, int argc, const VALUE *argv)
block_handler = vm_proc_to_block_handler(VM_BH_TO_PROC(block_handler));
goto again;
case block_handler_type_symbol:
- return rb_sym_proc_call(SYM2ID(VM_BH_TO_SYMBOL(block_handler)), 1, &self, VM_BLOCK_HANDLER_NONE);
+ return rb_sym_proc_call(SYM2ID(VM_BH_TO_SYMBOL(block_handler)),
+ argc, argv, VM_BLOCK_HANDLER_NONE);
}
new_captured.self = self;