[commit: ghc] master: Fix trac #10413 (010e187)
git at git.haskell.org
git at git.haskell.org
Wed Sep 2 11:49:25 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/010e1878c9c851a638211a03fd58bfa6bdd93081/ghc
>---------------------------------------------------------------
commit 010e1878c9c851a638211a03fd58bfa6bdd93081
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
>---------------------------------------------------------------
010e1878c9c851a638211a03fd58bfa6bdd93081
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 7188c05..e7b709f 100644
--- a/compiler/codeGen/StgCmmPrim.hs
+++ b/compiler/codeGen/StgCmmPrim.hs
@@ -417,7 +417,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]
@@ -428,7 +430,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