Project

General

Profile

Bug #16366

.count on endless range causes infinite loop

Added by duffyjp (Jacob Duffy) 10 months ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]
[ruby-core:95939]

Description

Out of curiosity, I tried:

(1..).count

Which resulted in an unkillable 100% CPU irb session.

I expected either an exception or maybe Infinity

Thanks


Files

enum_count_pass-16366.patch (765 Bytes) enum_count_pass-16366.patch jeremyevans0 (Jeremy Evans), 11/26/2019 03:58 AM

Also available in: Atom PDF