[commit: ghc] ghc-7.10: Return a [HsImplBang] from dataConImplBangs even with NoDataConRep (ccb7d96)

git at git.haskell.org git at git.haskell.org
Fri Jan 23 15:24:17 UTC 2015


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

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

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

commit ccb7d96da42663407f1cd73355821ca5a7f55e7f
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Jan 9 09:46:37 2015 +0000

    Return a [HsImplBang] from dataConImplBangs even with NoDataConRep
    
    This fixes Trac #9969, a new crash in T7562 that I somehow missed when
    fiddling with HsBang
    
    (cherry picked from commit 327ce1d336c8fbdb068be900a187f96d1c60b851)


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

ccb7d96da42663407f1cd73355821ca5a7f55e7f
 compiler/basicTypes/DataCon.hs | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/compiler/basicTypes/DataCon.hs b/compiler/basicTypes/DataCon.hs
index e77af96..3f27acd 100644
--- a/compiler/basicTypes/DataCon.hs
+++ b/compiler/basicTypes/DataCon.hs
@@ -830,9 +830,10 @@ dataConRepStrictness dc = case dcRep dc of
 dataConImplBangs :: DataCon -> [HsImplBang]
 -- The implementation decisions about the strictness/unpack of each
 -- source program argument to the data constructor
-dataConImplBangs dc = case dcRep dc of
-                       NoDataConRep              -> dcSrcBangs dc
-                       DCR { dcr_bangs = bangs } -> bangs
+dataConImplBangs dc
+  = case dcRep dc of
+      NoDataConRep              -> replicate (dcSourceArity dc) HsNoBang
+      DCR { dcr_bangs = bangs } -> bangs
 
 dataConBoxer :: DataCon -> Maybe DataConBoxer
 dataConBoxer (MkData { dcRep = DCR { dcr_boxer = boxer } }) = Just boxer



More information about the ghc-commits mailing list