[commit: ghc] late-lam-lift: fixed the sizeExpr typo bug (825749a)

Nicolas Frisby nicolas.frisby at gmail.com
Fri Apr 12 17:02:08 CEST 2013


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

On branch  : late-lam-lift

https://github.com/ghc/ghc/commit/825749ac42e83c7fb9cca1a6f78b1f73685e507f

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

commit 825749ac42e83c7fb9cca1a6f78b1f73685e507f
Author: Nicolas Frisby <nicolas.frisby at gmail.com>
Date:   Tue Mar 12 18:10:46 2013 +0000

    fixed the sizeExpr typo bug

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

 compiler/coreSyn/CoreUnfold.lhs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/compiler/coreSyn/CoreUnfold.lhs b/compiler/coreSyn/CoreUnfold.lhs
index a029a06..1a6a161 100644
--- a/compiler/coreSyn/CoreUnfold.lhs
+++ b/compiler/coreSyn/CoreUnfold.lhs
@@ -401,8 +401,10 @@ sizeExpr dflags bOMB_OUT_SIZE top_args expr
                       -- on nullary constructors
                     | otherwise       = size_up_call f [] 0
 
-    size_up (App fun arg) = size_up arg  `addSizeNSD`
-                            size_up_app fun [arg] (if isRealWorldExpr arg then 1 else 0)
+    size_up (App fun arg)
+      | isTyCoArg arg = size_up fun
+      | otherwise     = size_up arg  `addSizeNSD`
+                        size_up_app fun [arg] (if isRealWorldExpr arg then 1 else 0)
 
     size_up (Lam b e)
       | isId b && not (isRealWorldId b) = lamScrutDiscount dflags (size_up e `addSizeN` 10)





More information about the ghc-commits mailing list