[project @ 1999-12-13 16:10:56 by simonmar]
authorsimonmar <unknown>
Mon, 13 Dec 1999 16:10:56 +0000 (16:10 +0000)
committersimonmar <unknown>
Mon, 13 Dec 1999 16:10:56 +0000 (16:10 +0000)
Correct off-by-one error in bounds checking when converting
NoRepIntegers into the real thing.  Not a bug, just a cleanup.

ghc/compiler/simplCore/SimplCore.lhs

index b78ebc4..970838f 100644 (file)
@@ -515,8 +515,8 @@ otherwise, wrap with @addr2Integer@.
 litToRep (NoRepInteger i integer_ty)
   = returnPM (integer_ty, rhs)
   where
-    rhs | i > tARGET_MIN_INT &&                -- Small enough, so start from an Int
-         i < tARGET_MAX_INT
+    rhs | i >= tARGET_MIN_INT &&       -- Small enough, so start from an Int
+         i <= tARGET_MAX_INT
        = Con (DataCon smallIntegerDataCon) [Con (Literal (mkMachInt i)) []]
   
        | otherwise                     -- Big, so start from a string