[commit: ghc] supercompiler: Check deadness after InScopeSet substitution in CoreLint in case OccInfo only updated at binders (a5031b2)

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  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/a5031b295c190824ed7707bca3bd26cd899fffc3

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

commit a5031b295c190824ed7707bca3bd26cd899fffc3
Author: Max Bolingbroke <[email protected]>
Date:   Mon Jul 16 20:34:59 2012 +0100

    Check deadness after InScopeSet substitution in CoreLint in case OccInfo only updated at binders

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

 compiler/coreSyn/CoreLint.lhs |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/compiler/coreSyn/CoreLint.lhs b/compiler/coreSyn/CoreLint.lhs
index 41b0f3b..cc2715f 100644
--- a/compiler/coreSyn/CoreLint.lhs
+++ b/compiler/coreSyn/CoreLint.lhs
@@ -260,8 +260,8 @@ lintCoreExpr (Var var)
         ; checkL (isId var && not (isCoVar var))
                  (ptext (sLit "Non term variable") <+> ppr var)
 
-        ; checkDeadIdOcc var
 	; var' <- lookupIdInScope var
+        ; checkDeadIdOcc var'
         ; return (idType var') }
 
 lintCoreExpr (Lit lit)
@@ -276,8 +276,8 @@ lintCoreExpr (Cast expr co)
 
 lintCoreExpr (Tick (Breakpoint _ ids) expr)
   = do forM_ ids $ \id -> do
-         checkDeadIdOcc id
-         lookupIdInScope id
+         id' <- lookupIdInScope id
+         checkDeadIdOcc id'
        lintCoreExpr expr
 
 lintCoreExpr (Tick _other_tickish expr)
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.