Skip to content

Commit 47bac98

Browse files
committed
Ensure linear indexing in copyto_unaliased!
1 parent a3bcff4 commit 47bac98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/abstractarray.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ end
10791079

10801080
function copyto_unaliased!(::IndexLinear, dest::AbstractArray, ::IndexLinear, src::AbstractArray)
10811081
@_propagate_inbounds_meta
1082-
copyto!(dest, firstindex(dest), src, firstindex(src), length(src))
1082+
copyto!(dest, first(LinearIndices(dest)), src, first(LinearIndices(src)), length(src))
10831083
end
10841084
function copyto_unaliased!(deststyle::IndexStyle, dest::AbstractArray, ::IndexStyle, src::AbstractArray)
10851085
isempty(src) && return dest

0 commit comments

Comments
 (0)