summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-19 06:33:01 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-19 06:33:01 +0000
commitc1dc8a135473ad0edcd49c95117e62a490bfcd6c (patch)
tree8a5f1b198df89e84c4ed8deab95ca068b82baf6a
parent2fdf83ba3ea4d29c93dab9d6c3396ff4f1ca4dac (diff)
merge revision(s) 61711:
compile.c (iseq_compile_each0): remove irrelevant tracecoverage This change removes tracecoverage instructions on a line that has any NODE but is non-significant, such as, just one literal. This fixes the following failure that occurs only when coverage is enabled: 1) Failure: TestISeq#test_to_a_lines [.../ruby/test/ruby/test_iseq.rb:56]: <[3, 4, 7, 9]> expected but was <[3, 4, 5, 6, 7, 8, 9]>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@62481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--compile.c12
-rw-r--r--version.h6
2 files changed, 15 insertions, 3 deletions
diff --git a/compile.c b/compile.c
index fb385f9ee6..26bfa5e396 100644
--- a/compile.c
+++ b/compile.c
@@ -7093,6 +7093,18 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
return COMPILE_NG;
}
+ /* remove tracecoverage instruction if there is no relevant instruction */
+ if (IS_TRACE(ret->last) && ((TRACE*) ret->last)->event == RUBY_EVENT_LINE) {
+ LINK_ELEMENT *insn = ret->last->prev;
+ if (IS_INSN(insn) &&
+ IS_INSN_ID(insn, tracecoverage) &&
+ FIX2LONG(OPERAND_AT(insn, 0)) == RUBY_EVENT_COVERAGE_LINE
+ ) {
+ ELEM_REMOVE(insn); /* remove tracecovearge */
+ RARRAY_ASET(ISEQ_LINE_COVERAGE(iseq), line - 1, Qnil);
+ }
+ }
+
debug_node_end();
return COMPILE_OK;
}
diff --git a/version.h b/version.h
index 34521b6a54..1ac49e41c9 100644
--- a/version.h
+++ b/version.h
@@ -1,10 +1,10 @@
#define RUBY_VERSION "2.5.0"
-#define RUBY_RELEASE_DATE "2018-02-18"
-#define RUBY_PATCHLEVEL 21
+#define RUBY_RELEASE_DATE "2018-02-19"
+#define RUBY_PATCHLEVEL 22
#define RUBY_RELEASE_YEAR 2018
#define RUBY_RELEASE_MONTH 2
-#define RUBY_RELEASE_DAY 18
+#define RUBY_RELEASE_DAY 19
#include "ruby/version.h"