summaryrefslogtreecommitdiff
path: root/src/corify.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/corify.sml')
-rw-r--r--src/corify.sml10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corify.sml b/src/corify.sml
index c3a53094..075047a2 100644
--- a/src/corify.sml
+++ b/src/corify.sml
@@ -1011,11 +1011,19 @@ fun corifyDecl mods (all as (d, loc : EM.span), st) =
t, tf, e), loc),
(L.TFun (t, tf), loc)))
((L.EApp (ef, ea), loc), ranT) args
+
+ val expKind = if List.exists (fn t =>
+ case corifyCon st t of
+ (L'.CFfi ("Basis", "postBody"), _) => true
+ | _ => false) args then
+ L'.Extern L'.ReadCookieWrite
+ else
+ L'.Link
in
((L.DVal ("wrap_" ^ s, 0, tf, e), loc) :: wds,
(fn st =>
case #1 (corifyExp st (L.EModProj (en, [], "wrap_" ^ s), loc)) of
- L'.ENamed n => (L'.DExport (L'.Link, n, false), loc)
+ L'.ENamed n => (L'.DExport (expKind, n, false), loc)
| _ => raise Fail "Corify: Value to export didn't corify properly")
:: eds)
end