diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-02-25 16:11:04 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-03-03 08:12:39 -0500 |
commit | 8a433a3c883a6fd0a7829abbbd201953c70cd979 (patch) | |
tree | 8f487faf4bb6d2a1f37e0821e255d6f73b89812f /compiler/GHC/Tc/Utils | |
parent | 38748d5fb44dc6e7bc324d0b0c4aff8580d0733a (diff) | |
download | haskell-8a433a3c883a6fd0a7829abbbd201953c70cd979.tar.gz |
Fix leaks of the HscEnv with quick flavour (#19356)
Thanks @mpickering for finding them!
Diffstat (limited to 'compiler/GHC/Tc/Utils')
-rw-r--r-- | compiler/GHC/Tc/Utils/Monad.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/GHC/Tc/Utils/Monad.hs b/compiler/GHC/Tc/Utils/Monad.hs index 493602fea0..a3c087c4da 100644 --- a/compiler/GHC/Tc/Utils/Monad.hs +++ b/compiler/GHC/Tc/Utils/Monad.hs @@ -258,8 +258,9 @@ initTc hsc_env hsc_src keep_rn_syntax mod loc do_this th_state_var <- newIORef Map.empty ; th_remote_state_var <- newIORef Nothing ; let { - dflags = hsc_dflags hsc_env ; - home_unit = hsc_home_unit hsc_env ; + -- bangs to avoid leaking the env (#19356) + !dflags = hsc_dflags hsc_env ; + !home_unit = hsc_home_unit hsc_env ; maybe_rn_syntax :: forall a. a -> Maybe a ; maybe_rn_syntax empty_val @@ -2021,8 +2022,9 @@ initIfaceTcRn :: IfG a -> TcRn a initIfaceTcRn thing_inside = do { tcg_env <- getGblEnv ; hsc_env <- getTopEnv + -- bangs to avoid leaking the envs (#19356) ; let !mod = tcg_semantic_mod tcg_env - home_unit = hsc_home_unit hsc_env + !home_unit = hsc_home_unit hsc_env -- When we are instantiating a signature, we DEFINITELY -- do not want to knot tie. is_instantiate = isHomeUnitInstantiating home_unit |