You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reviewing all occurrences of conversions to the abstract type AbstractArray in LinearAlgebra, I came across this corner-case issue:
julia>using LinearAlgebra
julia> l =lu(rand(3,3)); v =transpose(rand(3));
julia> v
1×3 Transpose{Float64,Array{Float64,1}}:0.3031530.9352160.228176
julia> v /adjoint(l)
1×3 Adjoint{Float64,Array{Float64,1}}:1.78182-0.0651590.00787519
julia> v
1×3 Transpose{Float64,Array{Float64,1}}:1.78182-0.0651590.00787519
The vector v here is accidentally overwritten. The offending line is this one, where in the statement convert(AbstractVector{T}, conj(trA.parent)) neither conj nor the conversion is guaranteed to actually copy the data in all cases. There is a similar issue three lines below it (with equally exotic arguments).
My code review was motivated by JuliaLang/julia#34995 and I'm currently attempting to fix both issues.
The text was updated successfully, but these errors were encountered:
julia>using LinearAlgebra
julia> l =lu(rand(3,3)); v =transpose(rand(3));
julia> v
1×3transpose(::Vector{Float64}) with eltype Float64:0.140450.857080.644903
julia> v /adjoint(l)
1×3adjoint(::Vector{Float64}) with eltype Float64:0.1280851.384-0.657738
julia> v
1×3transpose(::Vector{Float64}) with eltype Float64:0.140450.857080.644903
Reviewing all occurrences of conversions to the abstract type
AbstractArray
in LinearAlgebra, I came across this corner-case issue:The vector
v
here is accidentally overwritten. The offending line is this one, where in the statementconvert(AbstractVector{T}, conj(trA.parent))
neitherconj
nor the conversion is guaranteed to actually copy the data in all cases. There is a similar issue three lines below it (with equally exotic arguments).My code review was motivated by JuliaLang/julia#34995 and I'm currently attempting to fix both issues.
The text was updated successfully, but these errors were encountered: