[project @ 2005-05-24 14:52:08 by simonmar]
authorsimonmar <unknown>
Tue, 24 May 2005 14:52:08 +0000 (14:52 +0000)
committersimonmar <unknown>
Tue, 24 May 2005 14:52:08 +0000 (14:52 +0000)
isObjectLinkable: don't return True for an empty linkable

ghc/compiler/main/HscTypes.lhs

index d2d63ca..d5727fe 100644 (file)
@@ -1006,7 +1006,12 @@ data Linkable = LM {
  }
 
 isObjectLinkable :: Linkable -> Bool
-isObjectLinkable l = all isObject (linkableUnlinked l)
+isObjectLinkable l = not (null unlinked) && all isObject unlinked
+  where unlinked = linkableUnlinked l
+       -- A linkable with no Unlinked's is treated as a BCO.  We can
+       -- generate a linkable with no Unlinked's as a result of
+       -- compiling a module in HscNothing mode, and this choice
+       -- happens to work well with checkStability in module GHC.
 
 instance Outputable Linkable where
    ppr (LM when_made mod unlinkeds)