[commit: ghc] wip/nested-cpr: Check mAX_CPR_SIZE in dmdAnalVarApp (5e875bc)

git at git.haskell.org git at git.haskell.org
Sat Dec 14 22:22:29 UTC 2013


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

On branch  : wip/nested-cpr
Link       : http://ghc.haskell.org/trac/ghc/changeset/5e875bc5835c9c6b0b5cffcbd1cd2fc68d159916/ghc

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

commit 5e875bc5835c9c6b0b5cffcbd1cd2fc68d159916
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Thu Dec 5 18:01:34 2013 +0000

    Check mAX_CPR_SIZE in dmdAnalVarApp


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

5e875bc5835c9c6b0b5cffcbd1cd2fc68d159916
 compiler/stranal/DmdAnal.lhs |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/compiler/stranal/DmdAnal.lhs b/compiler/stranal/DmdAnal.lhs
index d5bf8a0..3c613b2 100644
--- a/compiler/stranal/DmdAnal.lhs
+++ b/compiler/stranal/DmdAnal.lhs
@@ -522,6 +522,8 @@ dmdAnalVarApp env dmd fun args
   | Just con <- isDataConWorkId_maybe fun  -- Data constructor
   , isVanillaDataCon con
   , n_val_args == dataConRepArity con      -- Saturated
+  , dataConRepArity con > 0
+  , dataConRepArity con < 10 -- TODO: Sync with mAX_CPR_SIZE in MkId
   , let cpr_info = cprConRes (dataConTag con) arg_rets
         res_ty = foldl bothDmdType (DmdType emptyDmdEnv [] cpr_info) arg_tys
   = -- pprTrace "dmdAnalVarApp" (vcat [ ppr con, ppr args, ppr n_val_args, ppr cxt_ds



More information about the ghc-commits mailing list