Fix for print022 (round up when dividing type size by word size)
authorIan Lynagh <igloo@earth.li>
Sat, 14 Jul 2007 22:39:40 +0000 (22:39 +0000)
committerIan Lynagh <igloo@earth.li>
Sat, 14 Jul 2007 22:39:40 +0000 (22:39 +0000)
From Pepe Iborra (mnislaih)

compiler/ghci/RtClosureInspect.hs

index 3ffc8c2..1e69a89 100644 (file)
@@ -235,7 +235,7 @@ extractUnboxed tt clos = go tt (nonPtrs clos)
            | otherwise = pprPanic "Expected a TcTyCon" (ppr t)
          go [] _ = []
          go (t:tt) xx 
-           | (x, rest) <- splitAt (sizeofType t `div` wORD_SIZE) xx 
+           | (x, rest) <- splitAt ((sizeofType t + wORD_SIZE - 1) `div` wORD_SIZE) xx 
            = x : go tt rest
 
 sizeofTyCon = sizeofPrimRep . tyConPrimRep