diff --git a/src/runtime/mgcsweep.go b/src/runtime/mgcsweep.go index 104bd868faf..b7528ab68f1 100644 --- a/src/runtime/mgcsweep.go +++ b/src/runtime/mgcsweep.go @@ -101,7 +101,7 @@ func sweepone() uintptr { // This can happen if direct sweeping already // swept this span, but in that case the sweep // generation should always be up-to-date. - if s.sweepgen != sg { + if !(s.sweepgen == sg || s.sweepgen == sg+3) { print("runtime: bad span s.state=", s.state, " s.sweepgen=", s.sweepgen, " sweepgen=", sg, "\n") throw("non in-use span in unswept list") }