Skip to content

Commit

Permalink
small fix for collect(::Range....)
Browse files Browse the repository at this point in the history
should address test failure with commit 189b00a
  • Loading branch information
jakebolewski committed Feb 13, 2015
1 parent c5f66c2 commit 24c64b8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions base/range.jl
Original file line number Diff line number Diff line change
Expand Up @@ -498,12 +498,18 @@ convert{T}(::Type{FloatRange{T}}, r::OrdinalRange) =

## concatenation ##

function vcat{T}(rs::Range{T}...)
n::Int = 0
for r in rs; n+=length(r); end
function vcat{T}(r::Range{T}, rs::Range{T}...)
n::Int = length(r)
for ra in rs
n += length(ra)
end
a = Array(T,n)
i = 1
for r in rs, x in r
for x in r
@inbounds a[i] = x
i += 1
end
for ra in rs, x in ra
@inbounds a[i] = x
i += 1
end
Expand Down

5 comments on commit 24c64b8

@JeffBezanson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs more investigation! This can't be the real fix, since no Ranges are involved in the failing test:

julia> [((1,),)]
ERROR: StackOverflowError:
 in vect at abstractarray.jl:39
 in cat_t at abstractarray.jl:729
 in cat at ./abstractarray.jl:699
 in vcat at abstractarray.jl:745
 in vect at abstractarray.jl:39
 in cat_t at abstractarray.jl:729
 in cat at ./abstractarray.jl:699
 in vcat at abstractarray.jl:745
 in vect at abstractarray.jl:39
 in cat_t at abstractarray.jl:729
 in cat at ./abstractarray.jl:699
 in vcat at abstractarray.jl:745
 in vect at abstractarray.jl:39
 in cat_t at abstractarray.jl:729
 in cat at ./abstractarray.jl:699
 in vcat at abstractarray.jl:745
 in vect at abstractarray.jl:39
 in cat_t at abstractarray.jl:729
 in cat at ./abstractarray.jl:699
 in vcat at abstractarray.jl:745

@tkelman
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it might've been that this line

C = similar(isa(X[1],AbstractArray) ? full(X[1]) : [X[1]], typeC, tuple(dimsC...))
needs a semicolon but that was freezing during bootstrap at datafmt.jl

@JeffBezanson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm working on this; fingers crossed will have a fix soon.

@jakebolewski
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was 84e80f4 the fix for this?

@JeffBezanson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, 478dcb4 fixed this.

Please sign in to comment.