Bypass custom operator delete redirection in new.h and new.cpp when building with AddressSanitizer (LIBC_HAS_ADDRESS_SANITIZER). cpp::unique_ptr is the first heap-owning utility in src/__support/CPP/ that executes delete/delete[] expressions. Previously, new.h redirected operator delete via asm-renaming to __llvm_libc_delete (calling free()), which caused ASan to report an alloc-dealloc-mismatch (operator new vs free) when objects allocated via host operator new were deleted by cpp::unique_ptr. Guarding the custom operator delete implementations under ASan enables ASan deallocation tracking while preserving hermetic libc behavior for non-ASan builds. Assisted-by: Automated tooling, human reviewed. |
||
|---|---|---|
| .. | ||
| benchmarks | ||
| cmake | ||
| config | ||
| docs | ||
| examples | ||
| fuzzing | ||
| hdr | ||
| include | ||
| lib | ||
| shared | ||
| src | ||
| startup | ||
| test | ||
| utils | ||
| .clang-tidy | ||
| .gitignore | ||
| CMakeLists.txt | ||
| LICENSE.TXT | ||
| Maintainers.md | ||
| README.txt | ||
LLVM libc ========= This directory and its subdirectories contain source code for llvm-libc, a retargetable implementation of the C standard library. LLVM is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt.