summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-11-29 23:09:48 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-03-08 15:02:30 -0500
commit0edc543834d8172e54020c5272af1cf2d0b3437c (patch)
treecfbfc52994535982dfa951ff45ecd3934c98a82e
parent9b52840412c920a1a1eed26df37262bc6c82c171 (diff)
downloadhaskell-0edc543834d8172e54020c5272af1cf2d0b3437c.tar.gz
Evac: Squash data race in eval_selector_chain
-rw-r--r--rts/sm/Evac.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c
index 161ccb2e40..578ce153b9 100644
--- a/rts/sm/Evac.c
+++ b/rts/sm/Evac.c
@@ -1257,7 +1257,8 @@ selector_chain:
// save any space in any case, and updating with an indirection is
// trickier in a non-collected gen: we would have to update the
// mutable list.
- if (RELAXED_LOAD(&bd->flags) & (BF_EVACUATED | BF_NONMOVING)) {
+ uint16_t flags = RELAXED_LOAD(&bd->flags);
+ if (flags & (BF_EVACUATED | BF_NONMOVING)) {
unchain_thunk_selectors(prev_thunk_selector, (StgClosure *)p);
*q = (StgClosure *)p;
// shortcut, behave as for: if (evac) evacuate(q);
@@ -1273,7 +1274,7 @@ selector_chain:
// (scavenge_mark_stack doesn't deal with IND). BEWARE! This
// bit is very tricky to get right. If you make changes
// around here, test by compiling stage 3 with +RTS -c -RTS.
- if (bd->flags & BF_MARKED) {
+ if (flags & BF_MARKED) {
// must call evacuate() to mark this closure if evac==true
*q = (StgClosure *)p;
if (evac) evacuate(q);