X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FSparks.c;h=cb3d8d98eb26078b251da845168daeffc8af6ebe;hb=dcd38ff7690eb9bdfefc3e7b5c29b7269149df87;hp=e7273f3ed0167ff1bf7d16daaef2328759f35097;hpb=2b16fa4791b08b02df8461f3b79d0e44d72d0960;p=ghc-hetmet.git diff --git a/rts/Sparks.c b/rts/Sparks.c index e7273f3..cb3d8d9 100644 --- a/rts/Sparks.c +++ b/rts/Sparks.c @@ -389,6 +389,12 @@ pruneSparkQueue (evac_fn evac, void *user, Capability *cap) pool = cap->sparks; + // it is possible that top > bottom, indicating an empty pool. We + // fix that here; this is only necessary because the loop below + // assumes it. + if (pool->top > pool->bottom) + pool->top = pool->bottom; + // Take this opportunity to reset top/bottom modulo the size of // the array, to avoid overflow. This is only possible because no // stealing is happening during GC.