mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06:00
msvc: add asan support (disabled by default)
This commit is contained in:
@ -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) \
|
||||
|
Reference in New Issue
Block a user