summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-15 16:14:32 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-15 16:14:32 +0000
commit113d3599caa41605e54be08b84a9403adcdebc0c (patch)
tree2e3f6d889e24618d9d248c396254fbc86ccc799f
parente5633967eac299edab650bc77edfcebf3f2bd871 (diff)
merge revision(s) 41300: [Backport #8489]
* compile.c (rb_iseq_compile_node): fix location of a `trace' instruction (b_return event). [ruby-core:55305] [ruby-trunk - Bug #8489] (need a backport to 2.0.0?) * test/ruby/test_settracefunc.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@41319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog9
-rw-r--r--compile.c2
-rw-r--r--test/ruby/test_settracefunc.rb13
-rw-r--r--version.h2
4 files changed, 24 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 83aef3cd62..4a36d99d76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Sun Jun 16 01:11:10 2013 Koichi Sasada <ko1@atdot.net>
+
+ * compile.c (rb_iseq_compile_node): fix location of a `trace'
+ instruction (b_return event).
+ [ruby-core:55305] [ruby-trunk - Bug #8489]
+ (need a backport to 2.0.0?)
+
+ * test/ruby/test_settracefunc.rb: add a test.
+
Sun Jun 16 00:30:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* vm_eval.c (eval_string_with_cref): propagate absolute path from the
diff --git a/compile.c b/compile.c
index 510675952c..50b3d4c29a 100644
--- a/compile.c
+++ b/compile.c
@@ -483,8 +483,8 @@ rb_iseq_compile_node(VALUE self, NODE *node)
ADD_LABEL(ret, start);
ADD_TRACE(ret, FIX2INT(iseq->location.first_lineno), RUBY_EVENT_B_CALL);
COMPILE(ret, "block body", node->nd_body);
- ADD_TRACE(ret, nd_line(node), RUBY_EVENT_B_RETURN);
ADD_LABEL(ret, end);
+ ADD_TRACE(ret, nd_line(node), RUBY_EVENT_B_RETURN);
/* wide range catch handler must put at last */
ADD_CATCH_ENTRY(CATCH_TYPE_REDO, start, end, 0, start);
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb
index b010846b92..c6a23cc828 100644
--- a/test/ruby/test_settracefunc.rb
+++ b/test/ruby/test_settracefunc.rb
@@ -1007,4 +1007,17 @@ class TestSetTraceFunc < Test::Unit::TestCase
set_trace_func(nil)
end
end
+
+ def test_tracepoint_b_return_with_next
+ n = 0
+ TracePoint.new(:b_return){
+ n += 1
+ }.enable{
+ 3.times{
+ next
+ } # 3 times b_retun
+ } # 1 time b_return
+
+ assert_equal 4, n
+ end
end
diff --git a/version.h b/version.h
index 1d193e05f0..fc706be3d0 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.0.0"
#define RUBY_RELEASE_DATE "2013-06-16"
-#define RUBY_PATCHLEVEL 218
+#define RUBY_PATCHLEVEL 219
#define RUBY_RELEASE_YEAR 2013
#define RUBY_RELEASE_MONTH 6