Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in copyto! #34889

Closed
bkamins opened this issue Feb 26, 2020 · 0 comments · Fixed by #34891
Closed

Bug in copyto! #34889

bkamins opened this issue Feb 26, 2020 · 0 comments · Fixed by #34891
Milestone

Comments

@bkamins
Copy link
Member

bkamins commented Feb 26, 2020

The following code currently fails on master:

julia> copyto!([1,2], view(Int[],Int[]))
ERROR: BoundsError: attempt to access 2-element Array{Int64,1} at index [0]
Stacktrace:
 [1] throw_boundserror(::Array{Int64,1}, ::Tuple{Int64}) at ./abstractarray.jl:537
 [2] checkbounds at ./abstractarray.jl:502 [inlined]
 [3] copyto!(::Array{Int64,1}, ::SubArray{Int64,1,Array{Int64,1},Tuple{Array{Int64,1}},false}) at ./multidimensional.jl:975
 [4] top-level scope at REPL[23]:1

The reason is here: https://github.com/JuliaLang/julia/blob/master/base/multidimensional.jl#L975
and is most likely caused by #34049.

The problem is that empty source is incorrectly handled in this part of code.

CC @pablosanjose @timholy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants