X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FByteCodeGen.lhs;h=14b5ba4c0ed48ba89ad00a829b00f4ea208d1600;hb=9181d6e98088505d25703b6fbd753b449ca8e5a8;hp=d395aa06c1b550cc809cf4acaf62288425d4afe7;hpb=d97181b732076e19bbc109e6cc6393132a25af12;p=ghc-hetmet.git diff --git a/compiler/ghci/ByteCodeGen.lhs b/compiler/ghci/ByteCodeGen.lhs index d395aa0..14b5ba4 100644 --- a/compiler/ghci/ByteCodeGen.lhs +++ b/compiler/ghci/ByteCodeGen.lhs @@ -950,9 +950,10 @@ generateCCall d0 s p (CCallSpec target cconv _) fn args_r_to_l code_n_reps <- pargs d0 args_r_to_l let (pushs_arg, a_reps_pushed_r_to_l) = unzip code_n_reps + a_reps_sizeW = sum (map primRepSizeW a_reps_pushed_r_to_l) push_args = concatOL pushs_arg - d_after_args = d0 + sum (map primRepSizeW a_reps_pushed_r_to_l) + d_after_args = d0 + a_reps_sizeW a_reps_pushed_RAW | null a_reps_pushed_r_to_l || head a_reps_pushed_r_to_l /= VoidRep = panic "ByteCodeGen.generateCCall: missing or invalid World token?" @@ -1009,8 +1010,18 @@ generateCCall d0 s p (CCallSpec target cconv _) fn args_r_to_l DynamicTarget -> return (False, panic "ByteCodeGen.generateCCall(dyn)") StaticTarget target - -> do res <- ioToBc (lookupStaticPtr target) + -> do res <- ioToBc (lookupStaticPtr stdcall_adj_target) return (True, res) + where + stdcall_adj_target +#ifdef mingw32_TARGET_OS + | StdCallConv <- cconv + = let size = a_reps_sizeW * wORD_SIZE in + mkFastString (unpackFS target ++ '@':show size) +#endif + | otherwise + = target + -- in (is_static, static_target_addr) <- get_target_info let