diff options
author | Yusuke Endoh <[email protected]> | 2025-04-09 19:49:21 +0900 |
---|---|---|
committer | Yusuke Endoh <[email protected]> | 2025-04-09 23:45:54 +0900 |
commit | 0d6263bd416338a339651fb97fe4d62701704c4b (patch) | |
tree | 0d464288118cc14dad3cdc116401c2b486250ed7 /compile.c | |
parent | ce0d5cc06952317e8b0810ad978d6424f7ed9f6d (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |