From: simonmar Date: Mon, 13 Dec 1999 16:10:56 +0000 (+0000) Subject: [project @ 1999-12-13 16:10:56 by simonmar] X-Git-Tag: Approximately_9120_patches~5384 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=1fa4a56319ce1b5827d2101cc9fa256196517a4f;p=ghc-hetmet.git [project @ 1999-12-13 16:10:56 by simonmar] Correct off-by-one error in bounds checking when converting NoRepIntegers into the real thing. Not a bug, just a cleanup. --- diff --git a/ghc/compiler/simplCore/SimplCore.lhs b/ghc/compiler/simplCore/SimplCore.lhs index b78ebc4..970838f 100644 --- a/ghc/compiler/simplCore/SimplCore.lhs +++ b/ghc/compiler/simplCore/SimplCore.lhs @@ -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