Skip to content

Commit 891a316

Browse files
committed
Restored check
1 parent bf7bf6c commit 891a316

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

base/abstractarray.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2159,6 +2159,8 @@ _typed_hvncat(::Type{T}, ::Tuple{}, ::Bool) where T = Vector{T}()
21592159
_typed_hvncat(::Type{T}, ::Tuple{}, ::Bool, xs...) where T = Vector{T}()
21602160
_typed_hvncat(::Type{T}, ::Tuple{}, ::Bool, xs::Number...) where T = Vector{T}()
21612161
function _typed_hvncat(::Type{T}, dims::Tuple{Vararg{Int, N}}, row_first::Bool, xs::Number...) where {T, N}
2162+
all(>(0), dims) ||
2163+
throw(ArgumentError("`dims` argument must contain positive integers"))
21622164
A = Array{T, N}(undef, dims...)
21632165
lengtha = length(A) # Necessary to store result because throw blocks are being deoptimized right now, which leads to excessive allocations
21642166
lengthx = length(xs) # Cuts from 3 allocations to 1.

0 commit comments

Comments
 (0)