GhcMake: Clang/ASSERT fix
authorErik de Castro Lopo <erikd@mega-nerd.com>
Mon, 7 Mar 2016 13:32:07 +0000 (14:32 +0100)
committerBen Gamari <ben@smart-cactus.org>
Mon, 7 Mar 2016 13:32:09 +0000 (14:32 +0100)
Test Plan: Build with clang

Reviewers: thomie, rwbarton, austin, bgamari

Reviewed By: bgamari

Differential Revision: https://phabricator.haskell.org/D1977

compiler/main/GhcMake.hs

index 6232119..3655c0b 100644 (file)
@@ -367,10 +367,12 @@ load how_much = do
           liftIO $ intermediateCleanTempFiles dflags mods_to_keep hsc_env1
 
           -- there should be no Nothings where linkables should be, now
-          ASSERT(   isNoLink (ghcLink dflags)
+          let just_linkables =
+                    isNoLink (ghcLink dflags)
                  || all (isJust.hm_linkable)
                         (filter ((== HsSrcFile).mi_hsc_src.hm_iface)
-                                (eltsUFM hpt4))) do
+                                (eltsUFM hpt4))
+          ASSERT( just_linkables ) do
 
           -- Link everything together
           linkresult <- liftIO $ link (ghcLink dflags) dflags False hpt4