small refactoring
authorSimon Marlow <marlowsd@gmail.com>
Thu, 5 Jan 2012 14:02:24 +0000 (14:02 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Thu, 5 Jan 2012 15:20:18 +0000 (15:20 +0000)
compiler/nativeGen/X86/CodeGen.hs

index 5ba1069..e69aab4 100644 (file)
@@ -1690,6 +1690,7 @@ genCCall32 target dest_regs args =
         use_sse2 <- sse2Enabled
         push_codes <- mapM (push_arg use_sse2) (reverse args)
         delta <- getDeltaNat
+        MASSERT (delta == delta0 - tot_arg_size)
 
         -- in
         -- deal with static vs dynamic call targets
@@ -1728,10 +1729,10 @@ genCCall32 target dest_regs args =
                       (if pop_size==0 then [] else
                        [ADD II32 (OpImm (ImmInt pop_size)) (OpReg esp)])
                       ++
-                      [DELTA (delta + tot_arg_size)]
+                      [DELTA delta0]
                    )
         -- in
-        setDeltaNat (delta + tot_arg_size)
+        setDeltaNat delta0
 
         let
             -- assign the results, if necessary