Commit 10499f55 authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot

compiler: Initialize ForeignExportsList.n_entries

The refactoring in ed57c3a9 failed to
initialize this field, resulting in no exports being registered. A very
silly bug and yet somehow none of our tests caught it.

See #18548.

Fixes #19149.
parent 1de2050e
......@@ -715,7 +715,10 @@ foreignExportsInitialiser mod hs_fns =
-- See Note [Tracking foreign exports] in rts/ForeignExports.c
vcat
[ text "static struct ForeignExportsList" <+> list_symbol <+> equals
<+> braces (text ".exports = " <+> export_list) <> semi
<+> braces (
text ".exports = " <+> export_list <> comma <+>
text ".n_entries = " <+> ppr (length hs_fns))
<> semi
, text "static void " <> ctor_symbol <> text "(void)"
<+> text " __attribute__((constructor));"
, text "static void " <> ctor_symbol <> text "()"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment