Skip to content

Commit

Permalink
Fix infinite loop in the diff algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Mar 25, 2021
1 parent 0755bfc commit 0054f58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OMCompiler/Compiler/Parsers/SimpleModelicaParser.mo
Expand Up @@ -2195,7 +2195,7 @@ algorithm
guard min(parseTreeIsWhitespaceOrParNotComment(t) for t in tree)
algorithm
diff := (Diff.Equal, tree)::diff1::diff;
then diffLocal;
then {};
case ((diff1 as (Diff.Equal,tree1 as (_::_)))::(Diff.Delete, tree)::(diffLocal as ((Diff.Equal,tree2 as (_::_))::_)))
guard needsWhitespaceBetweenTokens(lastToken(List.last(tree1)), firstTokenInTree(listGet(tree2, 1)))
algorithm
Expand Down

0 comments on commit 0054f58

Please sign in to comment.