From dd834c683de09ae4f4ccfefbdaf4a36f20abc307 Mon Sep 17 00:00:00 2001 From: ktsj Date: Fri, 23 Dec 2011 16:23:13 +0000 Subject: * vm_eval.c (send_internal): PASS_PASSED_BLOCK_TH must be placed just before calling rb_call0. * bootstraptest/test_flow.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ bootstraptest/test_flow.rb | 13 +++++++++++++ vm_eval.c | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4536ee5195..f5790faa1a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sat Dec 24 01:20:39 2011 Kazuki Tsujimoto + + * vm_eval.c (send_internal): PASS_PASSED_BLOCK_TH must be placed + just before calling rb_call0. + + * bootstraptest/test_flow.rb: add a test for above. + Sat Dec 24 00:55:16 2011 Tanaka Akira * lib/tempfile.rb (Tempfile#initialize): warn if a block is given. diff --git a/bootstraptest/test_flow.rb b/bootstraptest/test_flow.rb index d40d814fbc..ed273953de 100644 --- a/bootstraptest/test_flow.rb +++ b/bootstraptest/test_flow.rb @@ -549,3 +549,16 @@ assert_equal %Q{ENSURE\n}, %q{ assert_equal "false", src + %q{e.all? {false}}, bug assert_equal "true", src + %q{e.include?(:foo)}, bug end +assert_equal %q{ok}, %q{ + $x = :ok + o = Object.new + def o.inspect(*args) + yield if block_given? + super + end + begin + nil.public_send(o) {$x = :ng} + rescue + end + $x +} diff --git a/vm_eval.c b/vm_eval.c index 44edf6f5ea..74f3e162b0 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -712,7 +712,6 @@ send_internal(int argc, const VALUE *argv, VALUE recv, call_type scope) } vid = *argv++; argc--; - PASS_PASSED_BLOCK_TH(th); id = rb_check_id(&vid); if (!id) { @@ -723,6 +722,7 @@ send_internal(int argc, const VALUE *argv, VALUE recv, call_type scope) } id = rb_to_id(vid); } + PASS_PASSED_BLOCK_TH(th); return rb_call0(recv, id, argc, argv, scope, self); } -- cgit v1.2.3