summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-23 11:00:48 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-23 11:00:48 +0000
commit919fa894f5e0fed105ad1513cb8be0748ae46295 (patch)
tree1601c866fc7d6b4764cbb852b7935ea4949ca56f /compile.c
parent1942e9254744bc9629d2c7ea0e670e75051311de (diff)
revert line number spec of *return events.
* compile.c (rb_iseq_compile_node): line number spec of :return, :b_return and :end events of 'TracePoint` is changed for [Feature #14104]. Quoted from [Feature #14104]: > Line numbers on :return/:b_return events show the last executed lines, > instead of end lines (without return statement). Note that :end event also affected. However, "buybug", a well-known ruby debugger depends on previous behavior so that I reverted this specification. * test/ruby/test_settracefunc.rb: catch up this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index 4ca855b002..95d0e5f891 100644
--- a/compile.c
+++ b/compile.c
@@ -646,6 +646,7 @@ rb_iseq_compile_node(rb_iseq_t *iseq, const NODE *node)
CHECK(COMPILE(ret, "block body", node->nd_body));
ADD_LABEL(ret, end);
ADD_TRACE(ret, RUBY_EVENT_B_RETURN);
+ ISEQ_COMPILE_DATA(iseq)->last_line = iseq->body->location.code_range.last_loc.lineno;
/* wide range catch handler must put at last */
ADD_CATCH_ENTRY(CATCH_TYPE_REDO, start, end, NULL, start);
@@ -657,6 +658,7 @@ rb_iseq_compile_node(rb_iseq_t *iseq, const NODE *node)
ADD_TRACE(ret, RUBY_EVENT_CLASS);
CHECK(COMPILE(ret, "scoped node", node->nd_body));
ADD_TRACE(ret, RUBY_EVENT_END);
+ ISEQ_COMPILE_DATA(iseq)->last_line = nd_line(node);
break;
}
case ISEQ_TYPE_METHOD:
@@ -664,6 +666,7 @@ rb_iseq_compile_node(rb_iseq_t *iseq, const NODE *node)
ADD_TRACE(ret, RUBY_EVENT_CALL);
CHECK(COMPILE(ret, "scoped node", node->nd_body));
ADD_TRACE(ret, RUBY_EVENT_RETURN);
+ ISEQ_COMPILE_DATA(iseq)->last_line = nd_line(node);
break;
}
default: {