[commit: ghc] ghc-7.10: Fix trac #10413 (5b34f18)

git at git.haskell.org git at git.haskell.org
Thu Oct 22 15:09:04 UTC 2015


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

On branch  : ghc-7.10
Link       : http://ghc.haskell.org/trac/ghc/changeset/5b34f18a9b7ad55801645824bed25eafaad5aa9b/ghc

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

commit 5b34f18a9b7ad55801645824bed25eafaad5aa9b
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


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

5b34f18a9b7ad55801645824bed25eafaad5aa9b
 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