Skip to content

Commit 6eea930

Browse files
committed
fix stack overflow for .*
1 parent d832e3a commit 6eea930

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

base/sparse/sparsematrix.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1783,7 +1783,9 @@ broadcast(::typeof(-), A::SparseMatrixCSC, B::Number) = full(A) .- B
17831783
broadcast(::typeof(-), A::Number, B::SparseMatrixCSC) = A .- full(B)
17841784
(-)(A::Array , B::SparseMatrixCSC) = A - full(B)
17851785

1786-
broadcast(::typeof(*), A::AbstractArray, B::AbstractArray) = broadcast_zpreserving(*, A, B)
1786+
broadcast(::typeof(*), A::SparseMatrixCSC, B::SparseMatrixCSC) = broadcast_zpreserving(*, A, B)
1787+
broadcast(::typeof(*), A::SparseMatrixCSC, B::Union{Array,BitArray}) = broadcast_zpreserving(*, A, B)
1788+
broadcast(::typeof(*), A::Union{Array,BitArray}, B::SparseMatrixCSC) = broadcast_zpreserving(*, A, B)
17871789
broadcast(::typeof(*), A::SparseMatrixCSC, B::Number) = SparseMatrixCSC(A.m, A.n, copy(A.colptr), copy(A.rowval), A.nzval .* B)
17881790
broadcast(::typeof(*), A::Number, B::SparseMatrixCSC) = SparseMatrixCSC(B.m, B.n, copy(B.colptr), copy(B.rowval), A .* B.nzval)
17891791

test/broadcast.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ import Base.Meta: isexpr
297297
@test isexpr(expand(:(f.(x,1.0))), :thunk)
298298
@test isexpr(expand(:(f.(x,$π))), :thunk)
299299

300+
# PR #17623: Fused binary operators
301+
@test [true] .* [true] == [true]
302+
300303
# PR 16988
301304
@test Base.promote_op(+, Bool) === Int
302305
@test isa(broadcast(+, [true]), Array{Int,1})

0 commit comments

Comments
 (0)