Skip to content

Commit

Permalink
fix infinite loop in D.Client.TargetSelector
Browse files Browse the repository at this point in the history
The pattern guard was clearly meant as a list-comprehension filter,
but on a let-bound pattern, it instead caused a circular loop in which
whether the LHS variables are bound the the RHS values depends on the
values of the LHS variables.

fixes #5081
  • Loading branch information
gelisam committed Apr 16, 2018
1 parent f3cacff commit 7ecff6e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cabal-install/Distribution/Client/TargetSelector.hs
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,9 @@ disambiguateTargetSelectors matcher matchInput exactMatch matchResults =
Left ( originalMatch
, [ (forgetFileStatus rendering, matches)
| rendering <- matchRenderings
, let (Match m _ matches) | m /= Inexact =
, let Match m _ matches =
memoisedMatches Map.! rendering
, m /= Inexact
] )

| (originalMatch, matchRenderings) <- matchResultsRenderings ]
Expand Down

0 comments on commit 7ecff6e

Please sign in to comment.