[project @ 2000-08-06 12:22:32 by panne]
authorpanne <unknown>
Sun, 6 Aug 2000 12:22:32 +0000 (12:22 +0000)
committerpanne <unknown>
Sun, 6 Aug 2000 12:22:32 +0000 (12:22 +0000)
Fixed conversion of MachWord to MachInt for large literals. Although
completely untested, I believe this fixes bug #111021.

ghc/compiler/basicTypes/Literal.lhs

index 3d53165..b8f495e 100644 (file)
@@ -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)