Project

General

Profile

Actions

Bug #13052

closed

Array#combination segfaults if the Array is modified during iteration

Added by rhenium (Kazuki Yamaguchi) over 7 years ago. Updated about 7 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:78738]

Description

Array#combination and Array#repeated_combination segfault if the Array is modified from the invoked block.

Reproduce:

ary = *1..100
ary.combination(1) { |x| p x; ary.clear } #=> segfault
# or ary.repeated_combination(1) { |x| p x; ary.clear } #=> segfault

This is the same as [Bug #9939], but it didn't fix the case of the argument is 1.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0