[commit: ghc] : Avoid overflow when using Deeds maxBound (6ced9eb)

Max Bolingbroke <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : 

http://hackage.haskell.org/trac/ghc/changeset/6ced9eb4f323248e3d1cdc636afd71cff7775383

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

commit 6ced9eb4f323248e3d1cdc636afd71cff7775383
Author: Max Bolingbroke <[email protected]>
Date:   Thu Dec 8 14:19:54 2011 +0000

    Avoid overflow when using Deeds maxBound

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

 .../supercompile/Supercompile/Evaluator/Deeds.hs   |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Evaluator/Deeds.hs b/compiler/supercompile/Supercompile/Evaluator/Deeds.hs
index 018785e..87768d8 100644
--- a/compiler/supercompile/Supercompile/Evaluator/Deeds.hs
+++ b/compiler/supercompile/Supercompile/Evaluator/Deeds.hs
@@ -23,7 +23,7 @@ instance Monoid Deeds where
     mappend = plusDeeds
 
 instance Bounded Deeds where
-    maxBound = Deeds { sizeLimit = maxBound, stepLimit = maxBound }
+    maxBound = Deeds { sizeLimit = maxBound `div` 2, stepLimit = maxBound `div` 2 } -- Try to avoid overflow :-)
     minBound = emptyDeeds
 
 emptyDeeds :: Deeds
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.