summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
Diffstat (limited to 'range.c')
-rw-r--r--range.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/range.c b/range.c
index e8a35c22cc..e4e73bd85d 100644
--- a/range.c
+++ b/range.c
@@ -2477,7 +2477,7 @@ range_overlap(VALUE range, VALUE other)
/* if both begin values are equal, no more comparisons needed */
if (rb_cmpint(cmp, self_beg, other_beg) == 0) return Qtrue;
}
- else if (NIL_P(self_beg) && NIL_P(other_beg)) {
+ else if (NIL_P(self_beg) && !NIL_P(self_end) && NIL_P(other_beg)) {
VALUE cmp = rb_funcall(self_end, id_cmp, 1, other_end);
return RBOOL(!NIL_P(cmp));
}