[PATCH] D145459: [hwasan] Add non-exception variant of operator delete[] for hwasan

Roland McGrath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 8 13:38:43 PST 2023


mcgrathr added a comment.

In D145459#4173866 <https://reviews.llvm.org/D145459#4173866>, @leonardchan wrote:

> Hmm, so test in `compiler-rt/test/hwasan/TestCases/new-test.cpp` does exercise this function via `operator delete[](alloc, size, align);`, but since we provide weak definitions for these symbols, even if the hwasan implementation isn't provided, then it'll default to the one provided by stdlib_new_delete.cpp.o in libc++. Not sure how easy it would be to tell the testing infrastructure not to use some specific symbols from libc++.

If hwasan had the same new vs malloc and new flavor matching stuff in its allocator that asan et al have, then the test could do each `operator new` signature and then call the internal form of the free function telling it to check that it came from the expected source. If it's instead the libc++ `new` that just calls malloc, you'll get a mismatch. And likewise you can use the internal allocation path with signature marker explicitly in the test, and then test against the `operator delete` signature.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145459/new/

https://reviews.llvm.org/D145459



More information about the llvm-commits mailing list