diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-23 11:00:48 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-23 11:00:48 +0000 |
commit | 919fa894f5e0fed105ad1513cb8be0748ae46295 (patch) | |
tree | 1601c866fc7d6b4764cbb852b7935ea4949ca56f /compile.c | |
parent | 1942e9254744bc9629d2c7ea0e670e75051311de (diff) | |
download | ruby-919fa894f5e0fed105ad1513cb8be0748ae46295.tar.gz |
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.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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: { |