Skip to content

Commit cf1d7a2

Browse files
committed
debug: repeat! stop if Y is too short
another clearer error is thrown later in the code
1 parent 81b1849 commit cf1d7a2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/general.jl

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ repeatdiag(A, n::Int) = kron(I(n), A)
4848
function repeat!(Y::Vector, a::Vector, n::Int)
4949
na = length(a)
5050
for i=0:n-1
51+
# stop if Y is too short, another clearer error is thrown later in the code:
52+
na*(i+1) > length(Y) && break
5153
Y[(1+na*i):(na*(i+1))] = a
5254
end
5355
return Y

0 commit comments

Comments
 (0)