[project @ 2003-12-10 14:15:16 by simonmar]
[ghc-hetmet.git] / ghc / compiler / ghci / ByteCodeAsm.lhs
index f067840..53340e7 100644 (file)
@@ -28,21 +28,22 @@ import TyCon                ( TyCon )
 import PrimOp          ( PrimOp )
 import PrimRep         ( PrimRep(..), isFollowableRep, is64BitRep )
 import Constants       ( wORD_SIZE )
-import FastString      ( FastString(..), unpackFS )
+import FastString      ( FastString(..) )
 import SMRep           ( StgWord )
 import FiniteMap
 import Outputable
 
-import Control.Monad   ( foldM, zipWithM )
-import Control.Monad.ST        ( ST, runST )
+import Control.Monad   ( foldM )
+import Control.Monad.ST        ( runST )
 
 import GHC.Word                ( Word(..) )
 import Data.Array.MArray
 import Data.Array.Unboxed ( listArray )
-import Data.Array.Base ( STUArray, UArray(..), unsafeWrite )
+import Data.Array.Base ( UArray(..) )
 import Data.Array.ST   ( castSTUArray )
 import Foreign         ( Word16, free )
 import Data.Int                ( Int64 )
+import Data.Char       ( ord )
 
 import GHC.Base                ( ByteArray# )
 import GHC.IOBase      ( IO(..) )
@@ -349,7 +350,7 @@ mkBits findLabel st proto_insns
        literal st (MachInt j)      = int st (fromIntegral j)
        literal st (MachFloat r)    = float st (fromRational r)
        literal st (MachDouble r)   = double st (fromRational r)
-       literal st (MachChar c)     = int st c
+       literal st (MachChar c)     = int st (ord c)
        literal st (MachInt64 ii)   = int64 st (fromIntegral ii)
        literal st (MachWord64 ii)  = int64 st (fromIntegral ii)
        literal st other            = pprPanic "ByteCodeLink.literal" (ppr other)