Closed
Description
Normally, invalid array sizes are caught by Core.checked_dims
, but Core.checked_dims(-10, 10, 10)
does not throw, leading to this error
julia> Array{Int}(undef, -10, 10, 10)
ERROR: ArgumentError: invalid GenericMemory size: too large for system address width
Stacktrace:
[1] GenericMemory
@ ./boot.jl:514 [inlined]
[2] new_as_memoryref
@ ./boot.jl:536 [inlined]
[3] Array
@ ./boot.jl:583 [inlined]
[4] (Array{Int64})(::UndefInitializer, m::Int64, n::Int64, o::Int64)
@ Core ./boot.jl:596
[5] top-level scope
@ REPL[64]:1
When "ERROR: ArgumentError: invalid Array dimensions" is more common. We should, at the very least, put an inline comment in the 3+ arg Core.checked_dims
method that notes this gap.