Skip to content

Commit 573e713

Browse files
committed
A more careful fix
1 parent 6c73af9 commit 573e713

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/systems/alias_elimination.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ end
475475
it === nothing && return nothing
476476
e, ns = it
477477
# c * a = b <=> a = c * b when -1 <= c <= 1
478-
return (ag[e][1], RootedAliasTree(iag, e)), (stage, iterate(it, ns))
478+
return (ag[e][1], RootedAliasTree(iag, e)), (stage, iterate(neighbors(invag, root), ns))
479479
end
480480

481481
count_nonzeros(a::AbstractArray) = count(!iszero, a)
@@ -739,6 +739,9 @@ function alias_eliminate_graph!(graph, var_to_diff, mm_orig::SparseMatrixCLIL)
739739

740740
if !isempty(irreducibles)
741741
ag = newag
742+
for k in keys(ag)
743+
push!(irreducibles, k)
744+
end
742745
mm_orig2 = isempty(ag) ? mm_orig : reduce!(copy(mm_orig), ag)
743746
mm = simple_aliases!(ag, graph, var_to_diff, mm_orig2, irreducibles)
744747
end

0 commit comments

Comments
 (0)