summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-07-22 16:37:58 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-08-04 13:58:01 -0400
commit0f43837f50d16b1fa24458d6ca2a042b52c95270 (patch)
tree46cbe8a726156ed63d5319d6f765483cfcf8e8aa
parentfffc75a92ec20976dbdb027a19ccb2315afd2618 (diff)
downloadhaskell-0f43837f50d16b1fa24458d6ca2a042b52c95270.tar.gz
Force name selectors to ensure no reference to Ids enter the NameCache
I observed some unforced thunks in the NameCache which were retaining a whole Id, which ends up retaining a Type.. which ends up retaining old copies of HscEnv containing stale HomeModInfo.
-rw-r--r--compiler/GHC/Iface/Tidy.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Iface/Tidy.hs b/compiler/GHC/Iface/Tidy.hs
index f395c0daa8..52a3291375 100644
--- a/compiler/GHC/Iface/Tidy.hs
+++ b/compiler/GHC/Iface/Tidy.hs
@@ -1093,12 +1093,12 @@ tidyTopName mod name_cache maybe_ref occ_env id
| otherwise = panic "tidyTopName"
where
- name = idName id
+ !name = idName id
external = isJust maybe_ref
global = isExternalName name
local = not global
internal = not external
- loc = nameSrcSpan name
+ !loc = nameSrcSpan name
old_occ = nameOccName name
new_occ | Just ref <- maybe_ref