From 3c0dfadf8fc761cb9cbf3c06301f9a2ecc2f2e51 Mon Sep 17 00:00:00 2001 From: simonmar <unknown> Date: Thu, 6 Apr 2000 13:37:10 +0000 Subject: [PATCH] [project @ 2000-04-06 13:37:10 by simonmar] fix ccall argument ordering --- ghc/compiler/absCSyn/PprAbsC.lhs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ghc/compiler/absCSyn/PprAbsC.lhs b/ghc/compiler/absCSyn/PprAbsC.lhs index 7c869bfb3a3b..24b0ff800882 100644 --- a/ghc/compiler/absCSyn/PprAbsC.lhs +++ b/ghc/compiler/absCSyn/PprAbsC.lhs @@ -346,7 +346,7 @@ pprAbsC stmt@(CCallTypedef is_tdef (CCall op_str is_asm may_gc cconv) results ar -- the first argument will be the "I/O world" token (a VoidRep) -- all others should be non-void non_void_args = - let nvas = tail args + let nvas = init args in ASSERT (all non_void nvas) nvas -- there will usually be two results: a (void) state which we @@ -798,9 +798,10 @@ pprCCall call@(CCall op_str is_asm may_gc cconv) args results vol_regs | otherwise = ( pp_basic_saves $$ pp_saves, pp_basic_restores $$ pp_restores) - non_void_args = let nvas = take (length args - 1) args - in ASSERT2 ( all non_void nvas, pprCCallOp call <+> hsep (map pprAmode args) ) - nvas + non_void_args = + let nvas = init args + in ASSERT2 ( all non_void nvas, pprCCallOp call <+> hsep (map pprAmode args) ) + nvas -- the last argument will be the "I/O world" token (a VoidRep) -- all others should be non-void -- GitLab