[Git][ghc/ghc][wip/js-staging] Linker: don't link the same unit twice

Sylvain Henry (@hsyl20) gitlab at gitlab.haskell.org
Wed Sep 28 14:27:04 UTC 2022



Sylvain Henry pushed to branch wip/js-staging at Glasgow Haskell Compiler / GHC


Commits:
04e9cfcd by Sylvain Henry at 2022-09-28T16:30:14+02:00
Linker: don't link the same unit twice

- - - - -


1 changed file:

- compiler/GHC/StgToJS/Linker/Linker.hs


Changes:

=====================================
compiler/GHC/StgToJS/Linker/Linker.hs
=====================================
@@ -260,7 +260,9 @@ link' env lc_cfg cfg logger unit_env target _include pkgs objFiles _jsFiles isRo
                         is_new_dep x = x `notElem` xs
                         new_deps     = filter is_new_dep deps
                     in case new_deps of
-                      [] -> transitive_units_ (u:xs) us
+                      []
+                        | u `elem` xs -> transitive_units_ xs us
+                        | otherwise   -> transitive_units_ (u:xs) us
                       ds -> transitive_units_ xs     (ds ++ (u:us))
 
           unit_not_found u = throwGhcException (CmdLineError ("unknown unit: " ++ unpackFS (unitIdFS u)))



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/04e9cfcd1485a8b90ef0987d8ffdaa8efb4fd9e1

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/04e9cfcd1485a8b90ef0987d8ffdaa8efb4fd9e1
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20220928/f30d3c9e/attachment.html>


More information about the ghc-commits mailing list