From 7693d3bd6b9b1327de60704dda6651a2edc562c6 Mon Sep 17 00:00:00 2001 From: sewardj Date: Wed, 3 Oct 2001 09:56:18 +0000 Subject: [PATCH] [project @ 2001-10-03 09:56:18 by sewardj] In the interactive FFI, handle f-i'd fns which return char. --- ghc/compiler/ghci/ByteCodeFFI.lhs | 2 ++ ghc/compiler/ghci/ByteCodeGen.lhs | 1 + 2 files changed, 3 insertions(+) diff --git a/ghc/compiler/ghci/ByteCodeFFI.lhs b/ghc/compiler/ghci/ByteCodeFFI.lhs index bcfee9d..89f212b 100644 --- a/ghc/compiler/ghci/ByteCodeFFI.lhs +++ b/ghc/compiler/ghci/ByteCodeFFI.lhs @@ -257,6 +257,7 @@ mkMarshalCode_wrk cconv (r_offW, r_rep) addr_offW arg_offs_n_reps fstps 4(%esi) -} ++ case r_rep of + CharRep -> movl_eax_offesimem 4 IntRep -> movl_eax_offesimem 4 WordRep -> movl_eax_offesimem 4 AddrRep -> movl_eax_offesimem 4 @@ -455,6 +456,7 @@ mkMarshalCode_wrk cconv (r_offW, r_rep) addr_offW arg_offs_n_reps f64 = [mkSTF f0 i0 4, mkSTF f1 i0 8] in case r_rep of + CharRep -> i32 IntRep -> i32 WordRep -> i32 AddrRep -> i32 diff --git a/ghc/compiler/ghci/ByteCodeGen.lhs b/ghc/compiler/ghci/ByteCodeGen.lhs index f1fe8dd..170a85c 100644 --- a/ghc/compiler/ghci/ByteCodeGen.lhs +++ b/ghc/compiler/ghci/ByteCodeGen.lhs @@ -838,6 +838,7 @@ generateCCall d0 s p ccall_spec@(CCallSpec target cconv safety) fn args_r_to_l mkDummyLiteral :: PrimRep -> Literal mkDummyLiteral pr = case pr of + CharRep -> MachChar 0 IntRep -> MachInt 0 DoubleRep -> MachDouble 0 FloatRep -> MachFloat 0 -- 1.7.10.4