From 7790cbadc7e21fb726128005a411a2afb24e815f Mon Sep 17 00:00:00 2001
From: simonm <unknown>
Date: Fri, 8 Jan 1999 16:14:49 +0000
Subject: [PATCH] [project @ 1999-01-08 16:14:49 by simonm] Generate static
 closures with float/double fields properly.

---
 ghc/compiler/nativeGen/AbsCStixGen.lhs | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/ghc/compiler/nativeGen/AbsCStixGen.lhs b/ghc/compiler/nativeGen/AbsCStixGen.lhs
index d692cdb43ac2..08dce9fe3782 100644
--- a/ghc/compiler/nativeGen/AbsCStixGen.lhs
+++ b/ghc/compiler/nativeGen/AbsCStixGen.lhs
@@ -167,26 +167,27 @@ Here we handle top-level things, like @CCodeBlock@s and
     -> UniqSM StixTreeList
  -}
  genCodeStaticClosure (CStaticClosure _ cl_info cost_centre amodes)
-  = returnUs (\xs -> table : xs)
+  = returnUs (\xs -> table ++ xs)
   where
-    table = StData PtrRep (StCLbl info_lbl : body)
-    info_lbl = infoTableLabelFromCI cl_info
+    table = StData PtrRep [StCLbl (infoTableLabelFromCI cl_info)] : 
+	    map (\amode -> StData (getAmodeRep amode) [a2stix amode]) amodes ++
+	    [StData PtrRep padding_wds]
 
     -- always at least one padding word: this is the static link field
     -- for the garbage collector.
-    body = if closureUpdReqd cl_info then
-    	    	take (1 + max mIN_UPD_SIZE (length amodes')) (amodes' ++ zeros)
-    	   else
-    	    	amodes' ++ [StInt 0]
+    padding_wds = if closureUpdReqd cl_info then
+    	    		take (1 + max 0 (mIN_UPD_SIZE - length amodes)) zeros
+    	   	  else
+    	    		[StInt 0]
 
     zeros = StInt 0 : zeros
 
-    amodes' = map amodeZeroVoid amodes
-
+    {- needed??? --SDM
     	-- Watch out for VoidKinds...cf. PprAbsC
     amodeZeroVoid item
       | getAmodeRep item == VoidRep = StInt 0
       | otherwise = a2stix item
+    -}
 
 \end{code}
 
-- 
GitLab