projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
861cfcf
)
Fix trac #1565: :r DoesNotExist needs to remove any let-bound values
author
Ian Lynagh
<igloo@earth.li>
Sat, 18 Aug 2007 15:22:50 +0000
(15:22 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Sat, 18 Aug 2007 15:22:50 +0000
(15:22 +0000)
compiler/main/GHC.hs
patch
|
blob
|
history
diff --git
a/compiler/main/GHC.hs
b/compiler/main/GHC.hs
index
506a839
..
bf276d5
100644
(file)
--- a/
compiler/main/GHC.hs
+++ b/
compiler/main/GHC.hs
@@
-273,7
+273,7
@@
import Control.Exception as Exception hiding (handle)
import Data.IORef
import System.IO
import System.IO.Error ( try, isDoesNotExistError )
import Data.IORef
import System.IO
import System.IO.Error ( try, isDoesNotExistError )
-import Prelude hiding (init)
+import Prelude hiding (init, catch)
-- -----------------------------------------------------------------------------
-- -----------------------------------------------------------------------------
@@
-539,9
+539,16
@@
load s@(Session ref) how_much
-- graph is still retained in the Session. We can tell which modules
-- were successfully loaded by inspecting the Session's HPT.
mb_graph <- depanal s [] False
-- graph is still retained in the Session. We can tell which modules
-- were successfully loaded by inspecting the Session's HPT.
mb_graph <- depanal s [] False
- case mb_graph of
- Just mod_graph -> load2 s how_much mod_graph
+ case mb_graph of
+ Just mod_graph -> catchingFailure $ load2 s how_much mod_graph
Nothing -> return Failed
Nothing -> return Failed
+ where catchingFailure f = f `catch` \e -> do
+ hsc_env <- readIORef ref
+ -- trac #1565 / test ghci021:
+ -- let bindings may explode if we try to use them after
+ -- failing to reload
+ writeIORef ref $! hsc_env{ hsc_IC = emptyInteractiveContext }
+ throw e
load2 s@(Session ref) how_much mod_graph = do
guessOutputFile s
load2 s@(Session ref) how_much mod_graph = do
guessOutputFile s