diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2014-05-23 08:15:52 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2014-08-28 11:14:14 +0100 |
commit | fa582cc4fbff690c3ce2243c0ca00ca29c029134 (patch) | |
tree | b44c61cabc67a30c9a03ca00db24eed05c0288eb | |
parent | b9e49d3e9580e13d89efd1f779cb76f610e0d6e0 (diff) | |
download | haskell-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.
-rw-r--r-- | compiler/coreSyn/CoreFVs.lhs | 2 |
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 |