diff --git a/mps/code/poolmrg.c b/mps/code/poolmrg.c index 1493991b775..1ff3a51405a 100644 --- a/mps/code/poolmrg.c +++ b/mps/code/poolmrg.c @@ -596,18 +596,18 @@ static Res MRGRefSegScan(ScanState ss, MRGRefSeg refseg, MRG mrg) /* free guardians are not scanned */ if (linkOfIndex(linkseg, i)->state != MRGGuardianFREE) { - ss->wasMarked = TRUE; - /* .ref.direct: We can access the reference directly */ - /* because we are in a scan and the shield is exposed. */ - if (TRACE_FIX1(ss, refPart->ref)) { - res = TRACE_FIX2(ss, &(refPart->ref)); - if (res != ResOK) - return res; - - if (ss->rank == RankFINAL && !ss->wasMarked) { /* .improve.rank */ - MRGFinalize(arena, linkseg, i); - } - } + ss->wasMarked = TRUE; + /* .ref.direct: We can access the reference directly */ + /* because we are in a scan and the shield is exposed. */ + if (TRACE_FIX1(ss, refPart->ref)) { + res = TRACE_FIX2(ss, &(refPart->ref)); + if (res != ResOK) + return res; + + if (ss->rank == RankFINAL && !ss->wasMarked) { /* .improve.rank */ + MRGFinalize(arena, linkseg, i); + } + } } } } TRACE_SCAN_END(ss);