diff options
author | Simon Marlow <marlowsd@gmail.com> | 2009-08-03 11:28:03 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2009-08-03 11:28:03 +0000 |
commit | 38b739b7fce555768cf8f0208a081f62eea479cc (patch) | |
tree | 942bfd31572770587920370819901e863ff8e11b | |
parent | fee305edfb4d6b63ba76d21ab605108b4d80284b (diff) | |
download | haskell-38b739b7fce555768cf8f0208a081f62eea479cc.tar.gz |
Fix #3412: the worker of an Id might not be a local Id
-rw-r--r-- | compiler/main/TidyPgm.lhs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/main/TidyPgm.lhs b/compiler/main/TidyPgm.lhs index b0fb7d3bc1..d198a3fe51 100644 --- a/compiler/main/TidyPgm.lhs +++ b/compiler/main/TidyPgm.lhs @@ -613,7 +613,7 @@ chooseExternalIds hsc_env mod omit_prags binds | otherwise = do (occ_env', name') <- tidyTopName mod nc_var (Just referrer) occ_env id let - rhs = expectJust "chooseExternalIds" $ lookupVarEnv bind_env id + rhs = expectJust (showSDoc (text "chooseExternalIds: " <> ppr id)) $ lookupVarEnv bind_env id (new_ids, show_unfold) | omit_prags = ([], False) | otherwise = addExternal id rhs @@ -635,7 +635,8 @@ addExternal :: Id -> CoreExpr -> ([Id],Bool) addExternal id rhs = (new_needed_ids, show_unfold) where new_needed_ids = unfold_ids ++ - filter (not . (`elemVarSet` unfold_set)) + filter (\id -> isLocalId id && + not (id `elemVarSet` unfold_set)) (varSetElems worker_ids ++ varSetElems spec_ids) -- XXX non-det ordering |