Bug 968520 - Explicitly use infallible allocator for ShiftData call in nsTArray::RemoveElementsAt. r=froydnj

This call will never fail so this merely makes the intent clear.
This commit is contained in:
Birunthan Mohanathas 2015-11-02 07:53:27 +02:00
parent 937f1db60f
commit a283d58dc4

View File

@ -793,6 +793,7 @@ class nsTArray_Impl
{
private:
typedef nsTArrayFallibleAllocator FallibleAlloc;
typedef nsTArrayInfallibleAllocator InfallibleAlloc;
public:
typedef typename nsTArray_CopyChooser<E>::Type copy_type;
@ -1649,8 +1650,9 @@ public:
// Check that the previous assert didn't overflow
MOZ_ASSERT(aStart <= aStart + aCount, "Start index plus length overflows");
DestructRange(aStart, aCount);
this->template ShiftData<Alloc>(aStart, aCount, 0,
sizeof(elem_type), MOZ_ALIGNOF(elem_type));
this->template ShiftData<InfallibleAlloc>(aStart, aCount, 0,
sizeof(elem_type),
MOZ_ALIGNOF(elem_type));
}
// A variation on the RemoveElementsAt method defined above.