[project @ 2000-04-06 13:37:10 by simonmar]
authorsimonmar <unknown>
Thu, 6 Apr 2000 13:37:10 +0000 (13:37 +0000)
committersimonmar <unknown>
Thu, 6 Apr 2000 13:37:10 +0000 (13:37 +0000)
fix ccall argument ordering

ghc/compiler/absCSyn/PprAbsC.lhs

index 7c869bf..24b0ff8 100644 (file)
@@ -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