Backport #2450

Array#sample can loop forever [patched]

Added by Marc-Andre Lafortune about 2 years ago. Updated 10 months ago.

[ruby-core:27075]
Status:Closed Start date:12/07/2009
Priority:Normal Due date:
Assignee: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 about 2 years ago

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

History

Updated by Shyouhei Urabe almost 2 years ago

  • Status changed from Closed to Assigned
  • Assignee set to Shyouhei Urabe

Updated by Shyouhei Urabe almost 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