summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2014-05-23 08:15:52 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2014-08-28 11:14:14 +0100
commitfa582cc4fbff690c3ce2243c0ca00ca29c029134 (patch)
treeb44c61cabc67a30c9a03ca00db24eed05c0288eb /compiler
parentb9e49d3e9580e13d89efd1f779cb76f610e0d6e0 (diff)
downloadhaskell-fa582cc4fbff690c3ce2243c0ca00ca29c029134.tar.gz
Fix an egregious bug in the NonRec case of bindFreeVars
We were missing the free variables of rules etc. It's correct for Rec but wrong for NonRec. I'm not sure how this bug hasn't bitten us before, but it cropped up when I was doing trimAutoRules.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/coreSyn/CoreFVs.lhs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/coreSyn/CoreFVs.lhs b/compiler/coreSyn/CoreFVs.lhs
index 4011191d75..69da1adaa6 100644
--- a/compiler/coreSyn/CoreFVs.lhs
+++ b/compiler/coreSyn/CoreFVs.lhs
@@ -82,7 +82,7 @@ exprsFreeVars = foldr (unionVarSet . exprFreeVars) emptyVarSet
-- | Find all locally defined free Ids in a binding group
bindFreeVars :: CoreBind -> VarSet
-bindFreeVars (NonRec _ r) = exprFreeVars r
+bindFreeVars (NonRec b r) = rhs_fvs (b,r) isLocalVar emptyVarSet
bindFreeVars (Rec prs) = addBndrs (map fst prs)
(foldr (union . rhs_fvs) noVars prs)
isLocalVar emptyVarSet