diff options
author | Ian Lynagh <ian@well-typed.com> | 2012-09-19 23:23:48 +0100 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2012-09-19 23:23:48 +0100 |
commit | 54affcef5e0f269bdcca3c160e7d6bff065adb8c (patch) | |
tree | e22e2f6b528f9300e8ab072e65fab9cffe4d8118 | |
parent | fe5821233d439c35c441cfc6c9d2029e5fd01342 (diff) | |
download | haskell-54affcef5e0f269bdcca3c160e7d6bff065adb8c.tar.gz |
Fix litFitsInChar
It was always False before
-rw-r--r-- | compiler/basicTypes/Literal.lhs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/basicTypes/Literal.lhs b/compiler/basicTypes/Literal.lhs index 220ef9edd1..a590eae1b2 100644 --- a/compiler/basicTypes/Literal.lhs +++ b/compiler/basicTypes/Literal.lhs @@ -351,10 +351,9 @@ litIsDupable dflags (LitInteger i _) = inIntRange dflags i litIsDupable _ _ = True litFitsInChar :: Literal -> Bool -litFitsInChar (MachInt i) - = fromInteger i <= ord minBound - && fromInteger i >= ord maxBound -litFitsInChar _ = False +litFitsInChar (MachInt i) = i >= toInteger (ord minBound) + && i <= toInteger (ord maxBound) +litFitsInChar _ = False litIsLifted :: Literal -> Bool litIsLifted (LitInteger {}) = True |