summaryrefslogtreecommitdiff
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 c2ce8274e5..4e0340d801 100644
--- a/thread.c
+++ b/thread.c
@@ -4768,7 +4768,7 @@ update_coverage(rb_event_flag_t event, VALUE proc, VALUE self, ID id, VALUE klas
if (coverage && RBASIC(coverage)->klass == 0) {
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;