diff options
| author | Léo Lam <leo@leolam.fr> | 2021-01-27 13:24:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-27 13:24:26 +0100 |
| commit | 305faa73ec5c646643db9b8526906480ada7c6fa (patch) | |
| tree | 368f15b4ae7cb55935b0d29ab4201c1c064b9da3 /Source/UnitTests/Core/PageFaultTest.cpp | |
| parent | 2537ea77ee33634a3ad6b616e8b0b5455046b87c (diff) | |
| parent | 2ba4fd960e20fc7e50280993967a6cd540fb77ab (diff) | |
Merge pull request #9436 from shuffle2/asan
msvc: enable asan compat
Diffstat (limited to 'Source/UnitTests/Core/PageFaultTest.cpp')
| -rw-r--r-- | Source/UnitTests/Core/PageFaultTest.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/UnitTests/Core/PageFaultTest.cpp b/Source/UnitTests/Core/PageFaultTest.cpp index 7b6210d7b9..e77fe49fd2 100644 --- a/Source/UnitTests/Core/PageFaultTest.cpp +++ b/Source/UnitTests/Core/PageFaultTest.cpp @@ -49,6 +49,17 @@ public: m_post_unprotect_time; }; +#ifdef _MSC_VER +#define ASAN_DISABLE __declspec(no_sanitize_address) +#else +#define ASAN_DISABLE +#endif + +static void ASAN_DISABLE perform_invalid_access(void* data) +{ + *(volatile int*)data = 5; +} + TEST(PageFault, PageFault) { EMM::InstallExceptionHandler(); @@ -61,7 +72,7 @@ TEST(PageFault, PageFault) pfjit.m_data = data; auto start = std::chrono::high_resolution_clock::now(); - *(volatile int*)data = 5; + perform_invalid_access(data); auto end = std::chrono::high_resolution_clock::now(); #define AS_NS(diff) \ |
