diff options
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/GHCi/UI.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 15cfcf3362..bcb6d6e38c 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -1688,7 +1688,8 @@ loadModule' files = do -- Grab references to the currently loaded modules so that we can -- see if they leak. - leak_indicators <- if gopt Opt_GhciLeakCheck (hsc_dflags hsc_env) + let !dflags = hsc_dflags hsc_env + leak_indicators <- if gopt Opt_GhciLeakCheck dflags then liftIO $ getLeakIndicators hsc_env else return (panic "no leak indicators") @@ -1700,8 +1701,8 @@ loadModule' files = do GHC.setTargets targets success <- doLoadAndCollectInfo False LoadAllTargets - when (gopt Opt_GhciLeakCheck (hsc_dflags hsc_env)) $ - liftIO $ checkLeakIndicators (hsc_dflags hsc_env) leak_indicators + when (gopt Opt_GhciLeakCheck dflags) $ + liftIO $ checkLeakIndicators dflags leak_indicators return success -- | @:add@ command |