From e022e6a0e146a4c6a28f9906dc1f715b5682a591 Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 24 May 2005 14:52:08 +0000 Subject: [PATCH] [project @ 2005-05-24 14:52:08 by simonmar] isObjectLinkable: don't return True for an empty linkable --- ghc/compiler/main/HscTypes.lhs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) -- 1.7.10.4