on master help sign in
Merge pull request #3860 from edmundsmith/issue3796

Fix for issue 3796 - 0/0 being compiled as -Infinity

commit011de20d8e1312db21e2841ccb677475a76f125c authorNiklas Larsson <metaniklas@gmail.com> dateFri 4 Aug 2017, 14:45 (9 years ago) parent202e93003496d1
4 files changed+7−5
idris.cabal+1−1 src/IRTS/CodegenC.hs+1−1 src/Idris/Core/Binary.hs+4−2 src/Idris/IBC.hs+1−1
idris.cabal+1−1
@@ -273,7 +273,7 @@ Library
273273 , ansi-wl-pprint < 0.7
274274 , array >= 0.4.0.1 && < 0.6
275275 , base64-bytestring < 1.1
276− , binary >= 0.7 && < 0.9
276+ , binary >= 0.8.4.1 && < 0.9
277277 , blaze-html >= 0.6.1.3 && < 0.10
278278 , blaze-markup >= 0.5.2.1 && < 0.9
279279 , bytestring < 0.11
src/IRTS/CodegenC.hs+1−1
@@ -208,7 +208,7 @@ bcc ((ASSIGNCONST l c):xs) = do
208208 mkConst (I i) = "MKINT(" ++ show i ++ ")"
209209 mkConst (BI i) | i < (2^30) = "MKINT(" ++ show i ++ ")"
210210 | otherwise = "MKBIGC(vm,\"" ++ show i ++ "\")"
211− mkConst (Fl f) = "MKFLOAT(vm, " ++ show f ++ ")"
211+ mkConst (Fl f) = "MKFLOAT(vm, " ++ (map toUpper $ show f) ++ ")"
212212 mkConst (Ch c) = "MKINT(" ++ show (fromEnum c) ++ ")"
213213 mkConst (Str s) = "MKSTR(vm, " ++ showCStr s ++ ")"
214214 mkConst (B8 x) = "idris_b8const(vm, " ++ show x ++ "U)"
src/Idris/Core/Binary.hs+4−2
@@ -16,6 +16,8 @@ import Control.Applicative ((<$>), (<*>))
1616import Control.DeepSeq (($!!))
1717import Control.Monad (liftM2)
1818import Data.Binary
19+import Data.Binary.Get
20+import Data.Binary.Put
1921import qualified Data.Text as T
2022import qualified Data.Text.Encoding as E
2123import Data.Vector.Binary
@@ -400,7 +402,7 @@ instance Binary Const where
400402 BI x1 -> do putWord8 1
401403 put x1
402404 Fl x1 -> do putWord8 2
403− put x1
405+ putDoublele x1
404406 Ch x1 -> do putWord8 3
405407 put x1
406408 Str x1 -> do putWord8 4
@@ -427,7 +429,7 @@ instance Binary Const where
427429 return (I x1)
428430 1 -> do x1 <- get
429431 return (BI x1)
430− 2 -> do x1 <- get
432+ 2 -> do x1 <- getDoublele
431433 return (Fl x1)
432434 3 -> do x1 <- get
433435 return (Ch x1)
src/Idris/IBC.hs+1−1
@@ -48,7 +48,7 @@ import System.Directory
4848import System.FilePath
4949
5050ibcVersion :: Word16
51−ibcVersion = 161
51+ibcVersion = 162
5252
5353-- | When IBC is being loaded - we'll load different things (and omit
5454-- different structures/definitions) depending on which phase we're in.