aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
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 87edfeb2ce..d2a73daed8 100644
--- a/compile.c
+++ b/compile.c
@@ -223,8 +223,9 @@ PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
#define ADD_TRACE(seq, line, event) \
do { \
if ((event) == RUBY_EVENT_LINE && iseq->coverage && \
- RARRAY_PTR(iseq->coverage)[(line) - 1] == Qnil) { \
+ (line) != iseq->compile_data->last_coverable_line) { \
RARRAY_PTR(iseq->coverage)[(line) - 1] = INT2FIX(0); \
+ iseq->compile_data->last_coverable_line = (line); \
ADD_INSN1(seq, line, trace, INT2FIX(RUBY_EVENT_COVERAGE)); \
} \
if (iseq->compile_data->option->trace_instruction) { \