summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@well-typed.com>2022-01-28 18:21:00 -0500
committerBen Gamari <ben@smart-cactus.org>2022-03-18 00:12:02 -0400
commite641ed1e4186a240d1ff64d9873a6619673cd36f (patch)
tree39ca6ae5cebf67361105c5c81c48733d4a3169bd
parentff4a5e2143796450d188037f769bfa4de890cb82 (diff)
downloadhaskell-wip/T21254.tar.gz
rts: Don't mark object code in markCAFs unless necessarywip/T21254
Previously `markCAFs` would call `markObjectCode` even in non-major GCs. This is problematic since `prepareUnloadCheck` is not called in such GCs, meaning that the section index has not been updated. Fixes #21254
-rw-r--r--rts/sm/GCAux.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/rts/sm/GCAux.c b/rts/sm/GCAux.c
index 41c24634c2..afed7b075d 100644
--- a/rts/sm/GCAux.c
+++ b/rts/sm/GCAux.c
@@ -157,7 +157,8 @@ markCAFs (evac_fn evac, void *user)
{
c = (StgIndStatic *)UNTAG_STATIC_LIST_PTR(c);
evac(user, &c->indirectee);
- markObjectCode(c);
+ // See Note [Object unloading] in CheckUnload.c
+ if (unload_mark_needed) markObjectCode(c);
}
for (StgIndStatic *c = revertible_caf_list;
@@ -166,6 +167,7 @@ markCAFs (evac_fn evac, void *user)
{
c = (StgIndStatic *)UNTAG_STATIC_LIST_PTR(c);
evac(user, &c->indirectee);
- markObjectCode(c);
+ // See Note [Object unloading] in CheckUnload.c
+ if (unload_mark_needed) markObjectCode(c);
}
}