summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Graf <sebastian.graf@kit.edu>2021-02-26 09:49:10 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-02-28 06:10:42 -0500
commit2454bb10a81e997100dd45b173ea11f2b24cf390 (patch)
treefd0083b0b5f5a9f1aecb4bd8c46336239b0a35f3
parent72c0e07869a4652399e669e529f1bfd456522ee0 (diff)
downloadhaskell-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.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