summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2025-04-09 19:49:21 +0900
committerYusuke Endoh <mame@ruby-lang.org>2025-04-09 23:45:54 +0900
commit0d6263bd416338a339651fb97fe4d62701704c4b (patch)
tree0d464288118cc14dad3cdc116401c2b486250ed7 /thread.c
parentce0d5cc06952317e8b0810ad978d6424f7ed9f6d (diff)
Fix coverage measurement for negative line numbers
Fixes [Bug #21220] Co-Authored-By: Mike Bourgeous <mike@mikebourgeous.com> Co-Authored-By: Jean Boussier <jean.boussier@gmail.com>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13089
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index 661ee977a9..b7aa911620 100644
--- a/thread.c
+++ b/thread.c
@@ -5662,6 +5662,7 @@ update_line_coverage(VALUE data, const rb_trace_arg_t *trace_arg)
VALUE lines = RARRAY_AREF(coverage, COVERAGE_INDEX_LINES);
if (lines) {
long line = rb_sourceline() - 1;
+ VM_ASSERT(line >= 0);
long count;
VALUE num;
void rb_iseq_clear_event_flags(const rb_iseq_t *iseq, size_t pos, rb_event_flag_t reset);