Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Dionne <ldionne.2@gmail.com>2020-12-17 21:26:47 +0300
committerLouis Dionne <ldionne.2@gmail.com>2021-01-09 01:03:50 +0300
commitbc556e5685c0f97e79fb7b3c6f15cc5062db8e36 (patch)
treef50c83e1d8ea3f1dd17dd3bb998d8ac62b9cba4e /libcxxabi/src/stdlib_new_delete.cpp
parent78b3bce23b113ab5dbd33d746ba48f2a3c20c5ff (diff)
[libc++/abi] Re-remove unnecessary null pointer checks from operator delete
In 7cd67904f776, we removed the unnecessary nullptr checks from the libc++abi definition of operator delete, but we forgot to update the definition in libc++ (damn code duplication!). Then, in d4a1e03c5fb5, I synced the definitions across libc++ and libc++abi, but I did it the wrong way around. I re-added the if() checks to libc++abi instead of removing them from libc++. In ef74f0fdc339, we re-removed the if() check from operator delete, but only in libc++abi. This patch corrects this mess and removes it consistently in libc++ and libc++abi. Differential Revision: https://reviews.llvm.org/D93473
Diffstat (limited to 'libcxxabi/src/stdlib_new_delete.cpp')
-rw-r--r--libcxxabi/src/stdlib_new_delete.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/libcxxabi/src/stdlib_new_delete.cpp b/libcxxabi/src/stdlib_new_delete.cpp
index a3e028be0fd2..8ef3057dd45e 100644
--- a/libcxxabi/src/stdlib_new_delete.cpp
+++ b/libcxxabi/src/stdlib_new_delete.cpp
@@ -214,9 +214,7 @@ _LIBCXXABI_WEAK
void
operator delete(void* ptr, std::align_val_t) _NOEXCEPT
{
- if (ptr) {
- std::__libcpp_aligned_free(ptr);
- }
+ std::__libcpp_aligned_free(ptr);
}
_LIBCXXABI_WEAK