Bug 1681243 - Use noexcept on arena_t's fallible allocator, even on Windows r=glandium

In clang-cl builds, thanks to clang-cl's defining of `_MSC_VER`, this function was not marked `noexcept`. This led clang to believe that it could call `arena_t`'s constructor without checking for null.

I suppose we could scope the condition down to real MSVC, but since we don't support that anymore, we can just stop checking.

Differential Revision: https://phabricator.services.mozilla.com/D99137
This commit is contained in:
David Major 2020-12-09 14:10:26 +00:00
Родитель 7c89351d34
Коммит 785368780a
1 изменённых файлов: 2 добавлений и 10 удалений

Просмотреть файл

@ -1027,11 +1027,7 @@ struct arena_t {
void* operator new(size_t aCount) = delete;
void* operator new(size_t aCount, const fallible_t&)
#if !defined(_MSC_VER) || defined(_CPPUNWIND)
noexcept
#endif
;
void* operator new(size_t aCount, const fallible_t&) noexcept;
void operator delete(void*);
};
@ -3488,11 +3484,7 @@ void* arena_t::Ralloc(void* aPtr, size_t aSize, size_t aOldSize) {
: RallocHuge(aPtr, aSize, aOldSize);
}
void* arena_t::operator new(size_t aCount, const fallible_t&)
#if !defined(_MSC_VER) || defined(_CPPUNWIND)
noexcept
#endif
{
void* arena_t::operator new(size_t aCount, const fallible_t&) noexcept {
MOZ_ASSERT(aCount == sizeof(arena_t));
return TypedBaseAlloc<arena_t>::alloc();
}