[commit: ghc] master: Add important missing case for bothCPR (4669c9e)

Simon Peyton Jones simonpj at microsoft.com
Thu Jun 6 15:30:35 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

https://github.com/ghc/ghc/commit/4669c9e6d0fa532534b8c71ab130ee2ebc22794c

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

commit 4669c9e6d0fa532534b8c71ab130ee2ebc22794c
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue May 28 09:03:12 2013 +0100

    Add important missing case for bothCPR
    
    If either side diverges, both do!

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

 compiler/basicTypes/Demand.lhs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/compiler/basicTypes/Demand.lhs b/compiler/basicTypes/Demand.lhs
index a2d752a..3e8096a 100644
--- a/compiler/basicTypes/Demand.lhs
+++ b/compiler/basicTypes/Demand.lhs
@@ -722,7 +722,8 @@ lubCPR _ _                     = NoCPR
 
 bothCPR :: CPRResult -> CPRResult -> CPRResult
 -- See Note [Asymmetry of 'both' for DmdType and DmdResult]
-bothCPR r _ = r
+bothCPR _ BotCPR = BotCPR   -- If either diverges, we diverge
+bothCPR r _      = r
 
 instance Outputable DmdResult where
   ppr RetProd    = char 'm' 





More information about the ghc-commits mailing list