mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-18 15:32:06 +00:00
msvc: add asan support (disabled by default)
This commit is contained in:
parent
79a234eff7
commit
49b9deeb03
3 changed files with 20 additions and 1 deletions
|
@ -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) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue