Project

General

Profile

Actions

Bug #13053

closed

Array#select! can resize to negative size

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

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

Description

Since Ruby 2.3 ([Feature #10714]), the following code cause the Array to be nagative number size.

ary = [1,2,3,4,5]
ary.select! { |i| ary.clear if i==5; false }
p ary #=> []
p ary.size #=> -5
Actions

Also available in: Atom PDF

Like0
Like0Like0