[llvm] [libcxxabi] [libc++abi] Avoid raw calls to assert() in libc++abi (PR #71121)

Louis Dionne via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 8 09:25:15 PST 2023


================
@@ -142,7 +142,7 @@ void* fallback_malloc(size_t len) {
 
     // Check the invariant that all heap_nodes pointers 'p' are aligned
     // so that 'p + 1' has an alignment of at least RequiredAlignment
-    assert(reinterpret_cast<size_t>(p + 1) % RequiredAlignment == 0);
+    _LIBCPP_ASSERT_UNCATEGORIZED(reinterpret_cast<size_t>(p + 1) % RequiredAlignment == 0, "");
----------------
ldionne wrote:

Because that part of libc++abi is not part of the demangler. The demangler is a special part of libc++abi that is shared with the rest of LLVM and that’s why we introduced a macro there.

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


More information about the llvm-commits mailing list