From: simonmar Date: Mon, 26 Feb 2001 16:42:48 +0000 (+0000) Subject: [project @ 2001-02-26 16:42:48 by simonmar] X-Git-Tag: Approximately_9120_patches~2544 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=6b8e1664b3d192546407954057d3a1a561fde840;p=ghc-hetmet.git [project @ 2001-02-26 16:42:48 by simonmar] Unload temporary bindings from the ClosureEnv properly at cmLoadModule time. --- diff --git a/ghc/compiler/compMan/CmLink.lhs b/ghc/compiler/compMan/CmLink.lhs index fb34f69..af0b8f4 100644 --- a/ghc/compiler/compMan/CmLink.lhs +++ b/ghc/compiler/compMan/CmLink.lhs @@ -109,6 +109,7 @@ updateClosureEnv pls new_bindings -- -- * otherwise, we unload it. -- +-- * we also implicitly unload all temporary bindings at this point. unload :: GhciMode -> DynFlags diff --git a/ghc/compiler/ghci/ByteCodeLink.lhs b/ghc/compiler/ghci/ByteCodeLink.lhs index 7000cbf..1619758 100644 --- a/ghc/compiler/ghci/ByteCodeLink.lhs +++ b/ghc/compiler/ghci/ByteCodeLink.lhs @@ -110,10 +110,13 @@ instance Outputable UnlinkedBCO where type ClosureEnv = FiniteMap Name HValue data HValue = HValue -- dummy type, actually a pointer to some Real Code. --- remove all entries for a given set of modules from the environment +-- remove all entries for a given set of modules from the environment; +-- note that this removes all local names too (ie. temporary bindings from +-- the command line). filterNameMap :: [ModuleName] -> FiniteMap Name a -> FiniteMap Name a filterNameMap mods env - = filterFM (\n _ -> moduleName (nameModule n) `elem` mods) env + = filterFM (\n _ -> isGlobalName n && + moduleName (nameModule n) `elem` mods) env \end{code} %************************************************************************