From b7b87096d8b669f0b4fa003320b25dad445ab064 Mon Sep 17 00:00:00 2001 From: oltolm Date: Wed, 12 Apr 2023 23:47:14 +0200 Subject: [PATCH] fix: make ASAN work on Windows --- Utilities/Thread.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index 591414051c..717e6a7809 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -1813,7 +1813,11 @@ static LONG exception_filter(PEXCEPTION_POINTERS pExp) noexcept const bool s_exception_handler_set = []() -> bool { +#ifdef USE_ASAN + if (!AddVectoredExceptionHandler(FALSE, (PVECTORED_EXCEPTION_HANDLER)exception_handler)) +#else if (!AddVectoredExceptionHandler(1, (PVECTORED_EXCEPTION_HANDLER)exception_handler)) +#endif { report_fatal_error("AddVectoredExceptionHandler() failed."); }