summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorYusuke Endoh <[email protected]>2025-04-09 19:49:21 +0900
committerYusuke Endoh <[email protected]>2025-04-09 23:45:54 +0900
commit0d6263bd416338a339651fb97fe4d62701704c4b (patch)
tree0d464288118cc14dad3cdc116401c2b486250ed7 /compile.c
parentce0d5cc06952317e8b0810ad978d6424f7ed9f6d (diff)
Fix coverage measurement for negative line numbers
Fixes [Bug #21220] Co-Authored-By: Mike Bourgeous <[email protected]> Co-Authored-By: Jean Boussier <[email protected]>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13089
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index e97c61eb10..a319d3cbb1 100644
--- a/compile.c
+++ b/compile.c
@@ -10746,7 +10746,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const no
if (nd_fl_newline(node)) {
int event = RUBY_EVENT_LINE;
ISEQ_COMPILE_DATA(iseq)->last_line = line;
- if (ISEQ_COVERAGE(iseq) && ISEQ_LINE_COVERAGE(iseq)) {
+ if (line > 0 && ISEQ_COVERAGE(iseq) && ISEQ_LINE_COVERAGE(iseq)) {
event |= RUBY_EVENT_COVERAGE_LINE;
}
ADD_TRACE(ret, event);