From 1bc6c3f40777ca10d8e7df38b775b0bb81a25881 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 1 Feb 2019 05:11:08 +0000 Subject: Revert r63383, r63248 "compile.c: copy a short insn with leave" When copying `leave` insn, TRACE also should be copied if it is present, but this optimization is trivial and not worth the complexity. [ruby-core:91366] [Bug #15578] 4cae5353c03009beb1e0a1619422072773580609 5afd479de63b6609ddcd1510da94d2c1ac384f7f git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_settracefunc.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index 6c07bf90f6..f8268ead68 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -2153,4 +2153,16 @@ class TestSetTraceFunc < Test::Unit::TestCase assert_equal Array.new(2){th}, events end + + def test_return_event_with_rescue + obj = Object.new + def obj.example + 1 if 1 == 1 + rescue + end + ok = false + tp = TracePoint.new(:return) {ok = true} + tp.enable {obj.example} + assert ok, "return event should be emitted" + end end -- cgit v1.2.3