summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-01 20:07:58 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-01 20:07:58 +0000
commit5bdd03936c2a7fb5c835587535466ec76bf0ca9e (patch)
tree6aa8af24b76d2155bbac0e47808c7833890ffcff /iseq.c
parent921385a6443338d6150e71acf0806108294c1c9a (diff)
* iseq.c (rb_iseq_line_trace_each): iterate `line' event only.
* test/ruby/test_iseq.rb: add a test for this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/iseq.c b/iseq.c
index 7fc35df3e7..42eba6eb25 100644
--- a/iseq.c
+++ b/iseq.c
@@ -1954,15 +1954,19 @@ rb_iseq_line_trace_each(VALUE iseqval, int (*func)(int line, rb_event_flag_t *ev
if (insn == BIN(trace)) {
rb_event_flag_t current_events = (VALUE)iseq->iseq[pos+1];
- rb_event_flag_t events = current_events & RUBY_EVENT_SPECIFIED_LINE;
- trace_num++;
-
- if (func) {
- int line = find_line_no(iseq, pos);
- /* printf("line: %d\n", line); */
- cont = (*func)(line, &events, data);
- if (current_events != events) {
- iseq->iseq[pos+1] = iseq->iseq_encoded[pos+1] = (VALUE)(current_events | (events & RUBY_EVENT_SPECIFIED_LINE));
+
+ if (current_events & RUBY_EVENT_LINE) {
+ rb_event_flag_t events = current_events & RUBY_EVENT_SPECIFIED_LINE;
+ trace_num++;
+
+ if (func) {
+ int line = find_line_no(iseq, pos);
+ /* printf("line: %d\n", line); */
+ cont = (*func)(line, &events, data);
+ if (current_events != events) {
+ iseq->iseq[pos+1] = iseq->iseq_encoded[pos+1] =
+ (VALUE)(current_events | (events & RUBY_EVENT_SPECIFIED_LINE));
+ }
}
}
}