Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
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.