From: simonmar Date: Tue, 24 May 2005 14:52:08 +0000 (+0000) Subject: [project @ 2005-05-24 14:52:08 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~477 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=e022e6a0e146a4c6a28f9906dc1f715b5682a591;p=ghc-hetmet.git [project @ 2005-05-24 14:52:08 by simonmar] isObjectLinkable: don't return True for an empty linkable --- diff --git a/ghc/compiler/main/HscTypes.lhs b/ghc/compiler/main/HscTypes.lhs index d2d63ca..d5727fe 100644 --- a/ghc/compiler/main/HscTypes.lhs +++ b/ghc/compiler/main/HscTypes.lhs @@ -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)