summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-07-20 11:38:18 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-08-04 13:58:01 -0400
commitfffc75a92ec20976dbdb027a19ccb2315afd2618 (patch)
tree3e9a1db8aa4e389ab4ffccc9595e913edc3b0578
parentfb529caedbe45160b41a20f28e21ee0ec372b05a (diff)
downloadhaskell-fffc75a92ec20976dbdb027a19ccb2315afd2618.tar.gz
Force safeInferred to avoid retaining extra copy of DynFlags
This will only have a (very) modest impact on memory but we don't want to retain old copies of DynFlags hanging around so best to force this value.
-rw-r--r--compiler/GHC/Driver/Session.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs
index 83a61d6e4d..ee032a2652 100644
--- a/compiler/GHC/Driver/Session.hs
+++ b/compiler/GHC/Driver/Session.hs
@@ -1946,7 +1946,8 @@ safeFlagCheck cmdl dflags =
" must be specified with a Safe Haskell flag"]
-- Have we inferred Unsafe? See Note [Safe Haskell Inference] in GHC.Driver.Main
- safeFlags = all (\(_,_,t,_) -> not $ t dflags) unsafeFlagsForInfer
+ -- Force this to avoid retaining reference to old DynFlags value
+ !safeFlags = all (\(_,_,t,_) -> not $ t dflags) unsafeFlagsForInfer
{- **********************************************************************