Commit 99836ac3 authored by Simon Marlow's avatar Simon Marlow
Browse files

pruneSparkQueue(): fix bug when top>bottom

parent 48685b25
......@@ -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.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment