aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-03 14:26:06 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-03 14:26:06 +0000
commitb0dd358c2feb240a18fbd711166697b336023018 (patch)
treee59051b5cb25f14ca7b6e45368118e083e762c98 /compile.c
parentbaf11a634ba2d065e71431b777f4068d25da4d0c (diff)
downloadruby-b0dd358c2feb240a18fbd711166697b336023018.tar.gz
Refactor the internal data format for coverage measurement
To prepare new measuring targets: branch and method coverages. So far, iseq->coverage was an array of counts executed for line coverage. Now, it is a three-element array for each measuring target, whose first element is an array for line coverage. The second element is planned for branch coverage, and the third will be for method coverage. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 05dcfa8fec..23816a6cfd 100644
--- a/compile.c
+++ b/compile.c
@@ -243,9 +243,10 @@ struct iseq_compile_data_ensure_node_stack {
#define ADD_TRACE(seq, line, event) \
do { \
if ((event) == RUBY_EVENT_LINE && ISEQ_COVERAGE(iseq) && \
+ ISEQ_LINE_COVERAGE(iseq) && \
(line) > 0 && \
(line) != ISEQ_COMPILE_DATA(iseq)->last_coverable_line) { \
- RARRAY_ASET(ISEQ_COVERAGE(iseq), (line) - 1, INT2FIX(0)); \
+ RARRAY_ASET(ISEQ_LINE_COVERAGE(iseq), (line) - 1, INT2FIX(0)); \
ISEQ_COMPILE_DATA(iseq)->last_coverable_line = (line); \
ADD_INSN1((seq), (line), trace, INT2FIX(RUBY_EVENT_COVERAGE)); \
} \