From: nagachika00@... Date: 2017-03-27T12:27:04+00:00 Subject: [ruby-core:80376] [Ruby trunk Bug#13053] Array#select! can resize to negative size Issue #13053 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 2.1: DONTNEED, 2.2: DONTNEED, 2.3: REQUIRED to 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONE ruby_2_3 r58149 merged revision(s) 57121. ---------------------------------------- Bug #13053: Array#select! can resize to negative size https://bugs.ruby-lang.org/issues/13053#change-63857 * Author: rhenium (Kazuki Yamaguchi) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: * Backport: 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONE ---------------------------------------- Since Ruby 2.3 ([Feature #10714]), the following code cause the Array to be nagative number size. ~~~ruby ary = [1,2,3,4,5] ary.select! { |i| ary.clear if i==5; false } p ary #=> [] p ary.size #=> -5 ~~~ -- https://bugs.ruby-lang.org/ Unsubscribe: