From 803030e7b6d014fc739d9dfcf6769af23fc868f3 Mon Sep 17 00:00:00 2001
From: panne <unknown>
Date: Sun, 6 Aug 2000 12:22:32 +0000
Subject: [PATCH] [project @ 2000-08-06 12:22:32 by panne] Fixed conversion of
 MachWord to MachInt for large literals. Although completely untested, I
 believe this fixes bug #111021.

---
 ghc/compiler/basicTypes/Literal.lhs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ghc/compiler/basicTypes/Literal.lhs b/ghc/compiler/basicTypes/Literal.lhs
index 3d53165f2d5b..b8f495eddf33 100644
--- a/ghc/compiler/basicTypes/Literal.lhs
+++ b/ghc/compiler/basicTypes/Literal.lhs
@@ -152,7 +152,7 @@ word2IntLit, int2WordLit, char2IntLit, int2CharLit,
  addr2IntLit, int2AddrLit, float2DoubleLit, double2FloatLit :: Literal -> Literal
 
 word2IntLit (MachWord w) 
-  | w > tARGET_MAX_INT = MachInt ((-1) + tARGET_MAX_WORD - w)
+  | w > tARGET_MAX_INT = MachInt (w - tARGET_MAX_WORD - 1)
   | otherwise	       = MachInt w
 
 int2WordLit (MachInt i)
-- 
GitLab