From: matz@... Date: 2019-11-28T06:28:11+00:00 Subject: [ruby-core:96011] [Ruby master Bug#16366] .count on endless range causes infinite loop Issue #16366 has been updated by matz (Yukihiro Matsumoto). `Enumerable#count` should aware of interrupts. Besides this case, `#count` should return `Infinity` (we may need to define `Range#count`). Matz. ---------------------------------------- Bug #16366: .count on endless range causes infinite loop https://bugs.ruby-lang.org/issues/16366#change-82849 * Author: duffyjp (Jacob Duffy) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- Out of curiosity, I tried: ``` ruby (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) -- https://bugs.ruby-lang.org/ Unsubscribe: