summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheng Shao <astrohavoc@gmail.com>2022-02-22 14:06:57 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-02-23 08:17:24 -0500
commit59b7f764489d3eb765e0b40e916b1438ff76e1fa (patch)
treebcffb21744564efa4a52d8e3e4456b41e57ac664
parent37deb893a915387d663416936b63f8fb74298f42 (diff)
downloadhaskell-59b7f764489d3eb765e0b40e916b1438ff76e1fa.tar.gz
Don't emit foreign exports initialiser code for empty CAF list
-rw-r--r--compiler/GHC/HsToCore/Foreign/Decl.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/GHC/HsToCore/Foreign/Decl.hs b/compiler/GHC/HsToCore/Foreign/Decl.hs
index 0c04929984..3575dda036 100644
--- a/compiler/GHC/HsToCore/Foreign/Decl.hs
+++ b/compiler/GHC/HsToCore/Foreign/Decl.hs
@@ -684,6 +684,7 @@ mkFExportCBits dflags c_nm maybe_target arg_htys res_hty is_IO_res_ty cc
foreignExportsInitialiser :: Module -> [Id] -> CStub
+foreignExportsInitialiser _ [] = mempty
foreignExportsInitialiser mod hs_fns =
-- Initialise foreign exports by registering a stable pointer from an
-- __attribute__((constructor)) function.