Bug 1290646 - Remove VS2012 crash workaround in nsTArray. r=jimm

This commit is contained in:
Chris Peterson 2016-07-28 11:51:25 -07:00
parent 39526a4f0c
commit 1eccabf8d3

View File

@ -43,6 +43,7 @@ namespace layers {
struct TileClient;
} // namespace layers
} // namespace mozilla
//
// nsTArray is a resizable array class, like std::vector.
//
@ -2240,12 +2241,11 @@ private:
static_assert(MOZ_ALIGNOF(elem_type) <= 8,
"can't handle alignments greater than 8, "
"see nsTArray_base::UsesAutoArrayBuffer()");
// Temporary work around for VS2012 RC compiler crash
Header** phdr = base_type::PtrToHdr();
*phdr = reinterpret_cast<Header*>(&mAutoBuf);
(*phdr)->mLength = 0;
(*phdr)->mCapacity = N;
(*phdr)->mIsAutoArray = 1;
*base_type::PtrToHdr() = reinterpret_cast<Header*>(&mAutoBuf);
base_type::Hdr()->mLength = 0;
base_type::Hdr()->mCapacity = N;
base_type::Hdr()->mIsAutoArray = 1;
MOZ_ASSERT(base_type::GetAutoArrayBuffer(MOZ_ALIGNOF(elem_type)) ==
reinterpret_cast<Header*>(&mAutoBuf),