Skip to content

Commit 738b89a

Browse files
committed
Initialize return value after dimension check
1 parent c8c6172 commit 738b89a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

stdlib/LinearAlgebra/src/symmetric.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,13 +415,12 @@ function triu(A::Symmetric, k::Integer=0)
415415
end
416416

417417
function dot(A::Symmetric, B::Symmetric)
418-
dotprod = zero(dot(first(A), first(B)))
419-
420418
n = size(A, 2)
421419
if n != size(B, 2)
422420
throw(DimensionMismatch("A has dimensions $(size(A)) but B has dimensions $(size(B))"))
423421
end
424422

423+
dotprod = zero(dot(first(A), first(B)))
425424
@inbounds if A.uplo == 'U' && B.uplo == 'U'
426425
for j in 1:n
427426
for i in 1:(j - 1)

0 commit comments

Comments
 (0)