mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-09 04:25:38 +00:00
Bug 771873 part 2 - Assert on addition overflow in nsTArray::RemoveElementsAt; r=bsmedberg
This commit is contained in:
parent
98c0f7c228
commit
c78113906d
@ -928,6 +928,8 @@ public:
|
||||
void RemoveElementsAt(index_type start, size_type count) {
|
||||
MOZ_ASSERT(count == 0 || start < Length(), "Invalid start index");
|
||||
MOZ_ASSERT(start + count <= Length(), "Invalid length");
|
||||
// Check that the previous assert didn't overflow
|
||||
MOZ_ASSERT(start <= start + count, "Start index plus length overflows");
|
||||
DestructRange(start, count);
|
||||
this->ShiftData(start, count, 0, sizeof(elem_type), MOZ_ALIGNOF(elem_type));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user