summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Graf <sebastian.graf@kit.edu>2021-02-26 09:49:10 +0100
committerSebastian Graf <sgraf1337@gmail.com>2021-02-27 11:43:03 -0500
commit833a6b84e2a43e2606e7a64a8df94c6fc3c5ba13 (patch)
treeffca5ba9e2645190a3a9f30a876ddfbd116d7624
parent157fe938eabf6428fa9de42d57f8cfad08b38ddb (diff)
downloadhaskell-833a6b84e2a43e2606e7a64a8df94c6fc3c5ba13.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.hs2
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