Bug 1439525 - Remove spurious "continue" statement. r?nical
The "continue" statement makes it look like the loop can run multiple
allocations in a row when that never actually happens. (And if it did,
the latter half of the loop would do the wrong thing). This patch
removes the spurious continue statement and replaces it with a more
useful assertion that documents the state at that point.
MozReview-Commit-ID: 3rpVZ1imX2y
--- a/gfx/layers/wr/IpcResourceUpdateQueue.cpp
+++ b/gfx/layers/wr/IpcResourceUpdateQueue.cpp
@@ -60,17 +60,19 @@ ShmSegmentsWriter::Write(Range<uint8_t>
MOZ_ASSERT(i > 0);
RefCountedShmem& shm = mSmallAllocs.ElementAt(i - 1);
RefCountedShm::Dealloc(mShmAllocator, shm);
mSmallAllocs.RemoveElementAt(i - 1);
}
MOZ_ASSERT(mSmallAllocs.Length() == currAllocLen);
return layers::OffsetRange(0, start, 0);
}
- continue;
+ // Allocation succeeded, so dstCursor should now be pointing to
+ // something inside the allocation buffer
+ MOZ_ASSERT(dstCursor < (mSmallAllocs.Length() * mChunkSize));
}
const size_t dstMaxOffset = mChunkSize * mSmallAllocs.Length();
const size_t dstBaseOffset = mChunkSize * (mSmallAllocs.Length() - 1);
MOZ_ASSERT(dstCursor >= dstBaseOffset);
MOZ_ASSERT(dstCursor <= dstMaxOffset);