[commit: ghc] master: Use varToCoreExpr in mkWWcpr_help (8f48fdc)

git at git.haskell.org git at git.haskell.org
Tue Jul 21 12:20:39 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/8f48fdc8f97c1f6f59e12a703e380d27760810b1/ghc

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

commit 8f48fdc8f97c1f6f59e12a703e380d27760810b1
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Mon Jul 20 23:34:31 2015 +0100

    Use varToCoreExpr in mkWWcpr_help
    
    Lacking this cuased Trac #10658.
    The fix is easy; it was a simple omission.


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

8f48fdc8f97c1f6f59e12a703e380d27760810b1
 compiler/stranal/WwLib.hs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/compiler/stranal/WwLib.hs b/compiler/stranal/WwLib.hs
index 304a3cb..b442f3d 100644
--- a/compiler/stranal/WwLib.hs
+++ b/compiler/stranal/WwLib.hs
@@ -635,7 +635,9 @@ mkWWcpr_help (data_con, inst_tys, arg_tys, co)
 
        ; return ( True
                 , \ wkr_call -> Case wkr_call arg (exprType con_app) [(DEFAULT, [], con_app)]
-                , \ body     -> mkUnpackCase body co work_uniq data_con [arg] (Var arg)
+                , \ body     -> mkUnpackCase body co work_uniq data_con [arg] (varToCoreExpr arg)
+                                -- varToCoreExpr important here: arg can be a coercion
+                                -- Lacking this caused Trac #10658
                 , arg_ty1 ) }
 
   | otherwise   -- The general case



More information about the ghc-commits mailing list