JuliaLang/julia — pull request #8255 by rfourquet (2014-09-06 12:11:20+00:00)
Title: fix infinite loop in `rand(::Range(BigInt))`

The call `rand(big(1):big(2))` was causing a stack overflow. It's not the best possible fix, as this works now only for ranges whose length fit in an `Int`. The simplest other solutions I see is to use `rand(UnitRange{Uint128})` to implement `rand(r::Range{BigInt})` (for big ranges of length up to `typemax(Uint128)`), or to constrain the `T` in `rand{T}(r::Range{T})` (random.jl line 210) to prevent (hopefully temporarily) a call to `rand` with a big range altogether.