Revert r342936 "Remove redundant null pointer check in operator delete"

A review for the change was opened in https://reviews.llvm.org/D52401
but the change was committed before being approved by any of the code
owners for libc++.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342938 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Louis Dionne
2018-09-25 04:13:08 +00:00
parent 32e3054763
commit c4b44869da

View File

@@ -135,7 +135,8 @@ _LIBCPP_WEAK
void
operator delete(void* ptr) _NOEXCEPT
{
::free(ptr);
if (ptr)
::free(ptr);
}
_LIBCPP_WEAK
@@ -256,10 +257,11 @@ _LIBCPP_WEAK
void
operator delete(void* ptr, std::align_val_t) _NOEXCEPT
{
if (ptr)
#if defined(_LIBCPP_MSVCRT_LIKE)
::_aligned_free(ptr);
::_aligned_free(ptr);
#else
::free(ptr);
::free(ptr);
#endif
}