Skip to content

Commit 75928e1

Browse files
committed
Ensure linear indexing in copyto_unaliased!
1 parent 0ce871d commit 75928e1

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
@@ -1078,7 +1078,7 @@ end
10781078

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

0 commit comments

Comments
 (0)