[commit: ghc] master: Return a [HsImplBang] from dataConImplBangs even with NoDataConRep (327ce1d)

git at git.haskell.org git at git.haskell.org
Fri Jan 9 10:07:27 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/327ce1d336c8fbdb068be900a187f96d1c60b851/ghc

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

commit 327ce1d336c8fbdb068be900a187f96d1c60b851
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


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

327ce1d336c8fbdb068be900a187f96d1c60b851
 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