[llvm] [libc] [compiler-rt] [clang] [mlir] [flang] [libcxx] [lld] [clang-tools-extra] [libc++][hardening] Classify assertions related to leaks and syscalls. (PR #77164)

Mark de Wever via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 21 05:05:48 PST 2024


================
@@ -280,6 +280,14 @@
 // - `_LIBCPP_ASSERT_NON_OVERLAPPING_RANGES` -- for functions that take several ranges as arguments, checks that the
 //   given ranges do not overlap.
 //
+// - `_LIBCPP_ASSERT_VALID_DEALLOCATION` -- checks that an attempt to deallocate memory is valid (e.g. the given object
+//   was allocated by the given allocator). Violating this category typically results in a memory leak.
+//
+// - `_LIBCPP_ASSERT_VALID_EXTERNAL_API_CALL` -- checks that a call to an external API (e.g. a syscall) doesn't fail in
+//   an unexpected manner. This includes triggering documented cases of undefined behavior in an external library (like
+//   attempting to unlock an unlocked mutex in pthreads). We generally don't expect these failures to compromize memory
+//   safety or otherwise create an immediate security issue.
+//
----------------
mordante wrote:

That probably happens after branching LLVM 18. After branching we can always backport documentation changes. So it would be great if we can get better documentation in LLVM 18.

https://github.com/llvm/llvm-project/pull/77164


More information about the cfe-commits mailing list