Array#reject aborts with callcc

Issue #9727 has been updated by Tomoyuki C…

Backport changed from 2.0.0: DONE, 2.1: REQUIRED to 2.0.0: DONE, 2.1:
DONE

r45562 was backported into ruby_2_1 branch at r46188.


Bug #9727: Array#reject aborts with callcc
https://bugs.ruby-lang.org/issues/9727#change-46920

  • Author: Nobuyoshi N.
  • Status: Closed
  • Priority: Normal
  • Assignee:
  • Category: core
  • Target version: current: 2.2.0
  • ruby -v: r45560
  • Backport: 2.0.0: DONE, 2.1: DONE

2.0.0以降で、以下のコードが異常終了します。

require 'continuation'
cont = nil
a = [*1..10].reject do |i|
  callcc{|c| cont = c} if !cont and i == 10
  false
end
a.unshift(:x)
cont.call if a.size < 1000

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs