diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-07-22 16:37:58 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-08-04 13:58:01 -0400 |
commit | 0f43837f50d16b1fa24458d6ca2a042b52c95270 (patch) | |
tree | 46cbe8a726156ed63d5319d6f765483cfcf8e8aa | |
parent | fffc75a92ec20976dbdb027a19ccb2315afd2618 (diff) | |
download | haskell-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.hs | 4 |
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 |