Two more External Core bugs
Kirsten Chevalier
krc at uclink.berkeley.edu
Wed Jul 9 19:38:37 EDT 2003
Two more bugs, both of which I was able to fix (patches attached):
- MkExternalCore.lhs didn't properly handle character literals greater than
0xff. It would generate code that contained something like (1010101::Char),
which made no sense. I changed it to use type Int instead of Char for these
literals.
- LexCore.hs ignored the sign of floating-point literals (so if a program
contained -1.0, it would be parsed as 1.0). I fixed it.
--
Kirsten Chevalier * krc at uclink.berkeley.edu * Often in error, never in doubt
-------------- next part --------------
Index: LexCore.hs
===================================================================
RCS file: /cvs/fptools/ghc/compiler/parser/LexCore.hs,v
retrieving revision 1.6
diff -r1.6 LexCore.hs
69c69
< | isDigit c -> cont (TKrational r) rest'
---
> | isDigit c -> cont (TKrational ((fromInteger sgn) * r)) rest'
-------------- next part --------------
Index: MkExternalCore.lhs
===================================================================
RCS file: /cvs/fptools/ghc/compiler/coreSyn/MkExternalCore.lhs,v
retrieving revision 1.20
diff -r1.20 MkExternalCore.lhs
166,167c166,167
< MachChar i | i <= 0xff -> C.Lchar (chr i) t
< MachChar i | otherwise -> C.Lint (toEnum i) t
---
> MachChar i | i <= 0xff -> C.Lchar (chr i) t
> MachChar i | otherwise -> C.Lint (toEnum i) (make_ty (literalType (MachInt (toInteger i))))
More information about the Glasgow-haskell-bugs
mailing list