Skip to content

Commit ef30028

Browse files
authored
Merge pull request #1349 from SciML/myb/fix
Make sure `x in AliasGraphKeySet` is in bounds
2 parents 0c6e5c9 + ad1ea6b commit ef30028

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

.github/workflows/Downstream.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
- {user: SciML, repo: NeuralPDE.jl, group: NNPDE}
2525
- {user: SciML, repo: DataDrivenDiffEq.jl, group: Standard}
2626
- {user: SciML, repo: StructuralIdentifiability.jl, group: All}
27+
- {user: SciML, repo: ModelingToolkitStandardLibrary.jl}
2728
steps:
2829
- uses: actions/checkout@v2
2930
- uses: julia-actions/setup-julia@v1

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ModelingToolkit"
22
uuid = "961ee093-0014-501f-94e3-6117800e7a78"
33
authors = ["Chris Rackauckas <[email protected]>"]
4-
version = "7.1.1"
4+
version = "7.1.2"
55

66
[deps]
77
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"

src/systems/alias_elimination.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ struct AliasGraphKeySet <: AbstractSet{Int}
181181
end
182182
Base.keys(ag::AliasGraph) = AliasGraphKeySet(ag)
183183
Base.iterate(agk::AliasGraphKeySet, state...) = Base.iterate(agk.ag.eliminated, state...)
184-
Base.in(i::Int, agk::AliasGraphKeySet) = agk.ag.aliasto[i] !== nothing
184+
function Base.in(i::Int, agk::AliasGraphKeySet)
185+
aliasto = agk.ag.aliasto
186+
1 <= i <= length(aliasto) && aliasto[i] !== nothing
187+
end
185188

186189
count_nonzeros(a::AbstractArray) = count(!iszero, a)
187190

0 commit comments

Comments
 (0)