From 3ab83fd7db8b4ff752bb86035e5a01c8720a42bf Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 20 Jun 2018 11:06:01 +0100 Subject: [PATCH] Add a check that the flipped trace was not already flipped. Copied from Perforce Change: 194006 --- mps/code/seg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mps/code/seg.c b/mps/code/seg.c index b5b2a46b76a..ca8e4b4a16a 100644 --- a/mps/code/seg.c +++ b/mps/code/seg.c @@ -1249,10 +1249,12 @@ static void mutatorSegFlip(Seg seg, Trace trace) NextMethod(Seg, MutatorSeg, flip)(seg, trace); - /* Raise the read barrier if the segment was not grey for any - currently flipped trace. */ arena = PoolArena(SegPool(seg)); flippedTraces = arena->flippedTraces; + AVER(!TraceSetIsMember(flippedTraces, trace)); + + /* Raise the read barrier if the segment was not grey for any + currently flipped trace. */ if (TraceSetInter(SegGrey(seg), flippedTraces) == TraceSetEMPTY) { ShieldRaise(arena, seg, AccessREAD); } else {