From e62a99b924a9b629eca48bfa3f74d1965bc0ecad Mon Sep 17 00:00:00 2001 From: ktsj Date: Fri, 16 Jan 2015 02:54:22 +0000 Subject: * eval_intern.h, vm.c, vm_eval.c, vm_insnhelper.c: change throw mechanism (not save target ep, but save target cfp). It fixes `unexpected break' bug that occurs when TracePoint#binding is called. [ruby-dev:48797] [Bug #10689] * test/ruby/test_settracefunc.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_settracefunc.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index 637078ae6e..58e927c217 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -977,6 +977,27 @@ class TestSetTraceFunc < Test::Unit::TestCase end end + def test_trace_point_binding_after_break + bug10689 = '[ruby-dev:48797]' + assert_in_out_err([], <<-INPUT, [], [], bug10689) + class Bug + include Enumerable + + def each + [0].each do + yield + end + end + end + + TracePoint.trace(:c_return) do |tp| + tp.binding + end + + Bug.new.all? { false } + INPUT + end + def test_tracepoint_b_return_with_next n = 0 TracePoint.new(:b_return){ -- cgit v1.2.3