aboutsummaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/thread.c b/thread.c
index 9d1e3fec60..a68651b2e1 100644
--- a/thread.c
+++ b/thread.c
@@ -4777,7 +4777,7 @@ update_coverage(rb_event_flag_t event, VALUE proc, VALUE self, ID id, VALUE klas
if (RB_TYPE_P(coverage, T_ARRAY) && !RBASIC_CLASS(coverage)) {
long line = rb_sourceline() - 1;
long count;
- if (RARRAY_AREF(coverage, line) == Qnil) {
+ if (line >= RARRAY_LEN(coverage)) { /* no longer tracked */
return;
}
count = FIX2LONG(RARRAY_AREF(coverage, line)) + 1;