Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This allows instrumenting programs which have their own versions of new and delete operators. Differential revision: https://reviews.llvm.org/D62794 llvm-svn: 362478
- Loading branch information
Showing
2 changed files
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// RUN: %clangxx_hwasan %s | ||
#include <stddef.h> | ||
#include <new> | ||
|
||
char *__dummy; | ||
|
||
void *operator new(size_t size) { return __dummy; } | ||
void *operator new[](size_t size) { return __dummy; } | ||
void *operator new(size_t size, std::nothrow_t const&) noexcept { | ||
return __dummy; | ||
} | ||
void *operator new[](size_t size, std::nothrow_t const&) noexcept { | ||
return __dummy; | ||
} | ||
|
||
void operator delete(void *ptr) noexcept {} | ||
void operator delete[](void *ptr) noexcept {} | ||
void operator delete(void *ptr, std::nothrow_t const&) noexcept {} | ||
void operator delete[](void *ptr, std::nothrow_t const&) noexcept {} | ||
|
||
int main() { | ||
return 0; | ||
} |