diff options
author | Sebastian Graf <sebastian.graf@kit.edu> | 2021-02-26 09:49:10 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-02-28 06:10:42 -0500 |
commit | 2454bb10a81e997100dd45b173ea11f2b24cf390 (patch) | |
tree | fd0083b0b5f5a9f1aecb4bd8c46336239b0a35f3 | |
parent | 72c0e07869a4652399e669e529f1bfd456522ee0 (diff) | |
download | haskell-2454bb10a81e997100dd45b173ea11f2b24cf390.tar.gz |
Make `Ord Literal` deterministic (#19438)
Previously, non-determinism arising from a use of `uniqCompareFS` in
`cmpLit` potentially crept into `CoreMap`, which we expect to behave
deterministically.
So we simply use `lexicalCompareFS` now.
Fixes #19438.
-rw-r--r-- | compiler/GHC/Types/Literal.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Types/Literal.hs b/compiler/GHC/Types/Literal.hs index 470828476d..90c253c12a 100644 --- a/compiler/GHC/Types/Literal.hs +++ b/compiler/GHC/Types/Literal.hs @@ -869,7 +869,7 @@ cmpLit (LitString a) (LitString b) = a `compare` b cmpLit (LitNullAddr) (LitNullAddr) = EQ cmpLit (LitFloat a) (LitFloat b) = a `compare` b cmpLit (LitDouble a) (LitDouble b) = a `compare` b -cmpLit (LitLabel a _ _) (LitLabel b _ _) = a `uniqCompareFS` b +cmpLit (LitLabel a _ _) (LitLabel b _ _) = a `lexicalCompareFS` b cmpLit (LitNumber nt1 a) (LitNumber nt2 b) | nt1 == nt2 = a `compare` b | otherwise = nt1 `compare` nt2 |