Skip to content
Snippets Groups Projects
Commit 9b4a7ddb authored by Cheng Shao's avatar Cheng Shao
Browse files

rts: do not prefetch mark_closure bdescr in non-moving gc when ASSERTS_ENABLED

This commit fixes a small an oversight in !12148: the prefetch logic
in non-moving GC may trap in debug RTS because it calls Bdescr() for
mark_closure which may be a static one. It's fine in non-debug RTS
because even invalid bdescr addresses are prefetched, they will not
cause segfaults, so this commit implements the most straightforward
fix: don't prefetch mark_closure bdescr when assertions are enabled.

(cherry picked from commit 886ab43a)
parent c0b1c0fb
No related branches found
No related tags found
No related merge requests found
......@@ -919,7 +919,9 @@ static MarkQueueEnt markQueuePop (MarkQueue *q)
// MarkQueueEnt encoding always places the pointer to the object to be
// marked first.
prefetchForRead(&new.mark_closure.p->header.info);
#if !defined(ASSERTS_ENABLED)
prefetchForRead(Bdescr((StgPtr) new.mark_closure.p));
#endif
q->prefetch_queue[i] = new;
i = (i + 1) % MARK_PREFETCH_QUEUE_DEPTH;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment