[commit: ghc] ghc-7.10: Fix trac #10413 (4a70e2f)

git at git.haskell.org git at git.haskell.org
Tue Sep 29 16:09:38 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-7.10
Link       : http://ghc.haskell.org/trac/ghc/changeset/4a70e2f128c636e7ab4fb60733b853e34474045f/ghc

>---------------------------------------------------------------

commit 4a70e2f128c636e7ab4fb60733b853e34474045f
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Wed Sep 2 13:26:22 2015 +0200

    Fix trac #10413
    
    Test Plan: Validate.
    
    Reviewers: austin, tibbe, bgamari
    
    Reviewed By: tibbe, bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1194
    
    GHC Trac Issues: #10413


>---------------------------------------------------------------

4a70e2f128c636e7ab4fb60733b853e34474045f
 compiler/codeGen/StgCmmPrim.hs | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/compiler/codeGen/StgCmmPrim.hs b/compiler/codeGen/StgCmmPrim.hs
index e208318..55b4264 100644
--- a/compiler/codeGen/StgCmmPrim.hs
+++ b/compiler/codeGen/StgCmmPrim.hs
@@ -412,7 +412,9 @@ emitPrimOp _      []  WriteSmallArrayOp [obj,ix,v] = doWriteSmallPtrArrayOp obj
 -- Getting the size of pointer arrays
 
 emitPrimOp dflags [res] SizeofArrayOp [arg]
-   = emit $ mkAssign (CmmLocal res) (cmmLoadIndexW dflags arg (fixedHdrSizeW dflags + oFFSET_StgMutArrPtrs_ptrs dflags) (bWord dflags))
+   = emit $ mkAssign (CmmLocal res) (cmmLoadIndexW dflags arg
+    (fixedHdrSizeW dflags + bytesToWordsRoundUp dflags (oFFSET_StgMutArrPtrs_ptrs dflags))
+        (bWord dflags))
 emitPrimOp dflags [res] SizeofMutableArrayOp [arg]
    = emitPrimOp dflags [res] SizeofArrayOp [arg]
 emitPrimOp dflags [res] SizeofArrayArrayOp [arg]
@@ -423,7 +425,8 @@ emitPrimOp dflags [res] SizeofMutableArrayArrayOp [arg]
 emitPrimOp dflags [res] SizeofSmallArrayOp [arg] =
     emit $ mkAssign (CmmLocal res)
     (cmmLoadIndexW dflags arg
-     (fixedHdrSizeW dflags + oFFSET_StgSmallMutArrPtrs_ptrs dflags) (bWord dflags))
+     (fixedHdrSizeW dflags + bytesToWordsRoundUp dflags (oFFSET_StgSmallMutArrPtrs_ptrs dflags))
+        (bWord dflags))
 emitPrimOp dflags [res] SizeofSmallMutableArrayOp [arg] =
     emitPrimOp dflags [res] SizeofSmallArrayOp [arg]
 



More information about the ghc-commits mailing list