Skip to content

Commit 23e5f6f

Browse files
committed
prevent conj! into uninitialized memory (#40481)
(cherry picked from commit aa7d879)
1 parent 5d046b5 commit 23e5f6f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/LinearAlgebra/src/matmul.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ function copyto!(B::AbstractVecOrMat, ir_dest::UnitRange{Int}, jr_dest::UnitRang
683683
copyto!(B, ir_dest, jr_dest, M, ir_src, jr_src)
684684
else
685685
LinearAlgebra.copy_transpose!(B, ir_dest, jr_dest, M, jr_src, ir_src)
686-
tM == 'C' && conj!(B)
686+
tM == 'C' && conj!(@view B[ir_dest, jr_dest])
687687
end
688688
B
689689
end
@@ -693,7 +693,7 @@ function copy_transpose!(B::AbstractMatrix, ir_dest::UnitRange{Int}, jr_dest::Un
693693
LinearAlgebra.copy_transpose!(B, ir_dest, jr_dest, M, ir_src, jr_src)
694694
else
695695
copyto!(B, ir_dest, jr_dest, M, jr_src, ir_src)
696-
tM == 'C' && conj!(B)
696+
tM == 'C' && conj!(@view B[ir_dest, jr_dest])
697697
end
698698
B
699699
end

0 commit comments

Comments
 (0)