diff --git a/code/seg.c b/code/seg.c index 9782e43b3c..49482c4c98 100644 --- a/code/seg.c +++ b/code/seg.c @@ -185,8 +185,6 @@ static void segAbsFinish(Inst inst) AVERT(Seg, seg); - RingRemove(SegPoolRing(seg)); - arena = PoolArena(SegPool(seg)); /* TODO: It would be good to avoid deprotecting segments eagerly @@ -205,6 +203,11 @@ static void segAbsFinish(Inst inst) ShieldFlush(PoolArena(SegPool(seg))); AVER(!seg->queued); + /* shieldDebugCheck requires SegFirst/SegNext to find all segments, + so the segment must remain on the pool ring until shield + operations are complete. */ + RingRemove(SegPoolRing(seg)); + limit = SegLimit(seg); TRACT_TRACT_FOR(tract, addr, arena, seg->firstTract, limit) {