Skip to content

Commit

Permalink
check array length before trying indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
adrpo authored and OpenModelica-Hudson committed Feb 10, 2017
1 parent ed7a5af commit 2a86f29
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Compiler/BackEnd/SymbolicJacobian.mo
Expand Up @@ -1567,16 +1567,11 @@ end mapIndexColors;
protected function createBipartiteGraph
input Integer inNode;
input array<list<Integer>> inSparsePattern;
output list<Integer> outEdges;
output list<Integer> outEdges = {};
algorithm
outEdges := matchcontinue(inNode,inSparsePattern)
case(_, _)
equation
outEdges = arrayGet(inSparsePattern,inNode);
then outEdges;
case(_, _)
then {};
end matchcontinue;
if arrayLength(inSparsePattern) <= inNode then
outEdges := arrayGet(inSparsePattern,inNode);
end if;
end createBipartiteGraph;

protected function createLinearModelMatrixes "This function creates the linear model matrices column-wise
Expand Down

0 comments on commit 2a86f29

Please sign in to comment.