summaryrefslogtreecommitdiff
path: root/compiler/GHC/StgToByteCode.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-06-21 12:28:23 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-06-23 03:00:23 -0400
commitd8e5b274dd258f85867e874a35fa719922a758f0 (patch)
treebd738328282dc7af4a597e68b4e6d7c6904448d8 /compiler/GHC/StgToByteCode.hs
parentaa1d0eb3629bd9d8fda3605c0b7b4dd52ee3d583 (diff)
downloadhaskell-d8e5b274dd258f85867e874a35fa719922a758f0.tar.gz
ghci: Correct free variable calculation in StgToByteCode
Fixes #20019
Diffstat (limited to 'compiler/GHC/StgToByteCode.hs')
-rw-r--r--compiler/GHC/StgToByteCode.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/GHC/StgToByteCode.hs b/compiler/GHC/StgToByteCode.hs
index 7dad6a87da..37a6539fe6 100644
--- a/compiler/GHC/StgToByteCode.hs
+++ b/compiler/GHC/StgToByteCode.hs
@@ -567,10 +567,8 @@ fvsToEnv :: BCEnv -> CgStgRhs -> [Id]
-- The code that constructs the thunk, and the code that executes
-- it, have to agree about this layout
-fvsToEnv p (StgRhsClosure fvs _ _ _ _) =
- [v | v <- dVarSetElems fvs,
- v `Map.member` p]
-fvsToEnv _ _ = []
+fvsToEnv p rhs = [v | v <- dVarSetElems $ freeVarsOfRhs rhs,
+ v `Map.member` p]
-- -----------------------------------------------------------------------------
-- schemeE