summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2023-09-04 19:51:40 +0900
committerYusuke Endoh <mame@ruby-lang.org>2023-09-04 19:52:08 +0900
commit4f4c1170bc988104f3bd3321558099af7ea19c18 (patch)
tree62a5dbd7abf53ef4776ad542118b45b6f1e4c9f0 /compile.c
parent4cc56592932d36c202b2366ffe7ad71db2f5ea0b (diff)
Revert "Don't reset line coverage for evaled code. (#8330)"
This reverts commit 7e0f5df2f99693267d61636d23da47f79924e9d5. https://bugs.ruby-lang.org/issues/19857#note-7
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index ba78040048..4d344fff9c 100644
--- a/compile.c
+++ b/compile.c
@@ -2336,8 +2336,7 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
!(rb_get_coverage_mode() & COVERAGE_TARGET_ONESHOT_LINES)) {
int line = iobj->insn_info.line_no - 1;
if (line >= 0 && line < RARRAY_LEN(ISEQ_LINE_COVERAGE(iseq))) {
- if (RARRAY_AREF(ISEQ_LINE_COVERAGE(iseq), line) == Qnil)
- RARRAY_ASET(ISEQ_LINE_COVERAGE(iseq), line, INT2FIX(0));
+ RARRAY_ASET(ISEQ_LINE_COVERAGE(iseq), line, INT2FIX(0));
}
}
if (ISEQ_BRANCH_COVERAGE(iseq) && (events & RUBY_EVENT_COVERAGE_BRANCH)) {