Backport #2450

Array#sample can loop forever [patched]

Added by marcandre (Marc-Andre Lafortune) over 2 years ago. Updated about 1 year ago.

[ruby-core:27075]
Status:Closed Start date:12/07/2009
Priority:Normal Due date:
Assignee:shyouhei (Shyouhei Urabe) % Done:

0%

Category:-
Target version:-

Description

[:hello].sample(42)  # ==> loops on Ruby 1.8.8

Fixed.

Other backports pass RubySpec.

Associated revisions

Revision 26030
Added by marcandre over 2 years ago

* array.c (rb_ary_sample): Fix infinite loop bug [ruby-core:27075]

History

Updated by shyouhei (Shyouhei Urabe) about 2 years ago

  • Status changed from Closed to Assigned
  • Assignee set to shyouhei (Shyouhei Urabe)

Updated by shyouhei (Shyouhei Urabe) about 2 years ago

  • Status changed from Assigned to Closed
Seems this bug does not affect to 1.8.7 & below.

Also available in: Atom PDF