From 1fa4a56319ce1b5827d2101cc9fa256196517a4f Mon Sep 17 00:00:00 2001 From: simonmar <unknown> Date: Mon, 13 Dec 1999 16:10:56 +0000 Subject: [PATCH] [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. --- ghc/compiler/simplCore/SimplCore.lhs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghc/compiler/simplCore/SimplCore.lhs b/ghc/compiler/simplCore/SimplCore.lhs index b78ebc4da148..970838f3c257 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 -- GitLab