Merge pull request #9477 from shuffle2/asan

windows: fix unregistering VEH
This commit is contained in:
Léo Lam 2021-01-27 15:47:55 +01:00 committed by GitHub
commit bb121dc9a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -87,9 +87,7 @@ static LONG NTAPI Handler(PEXCEPTION_POINTERS pPtrs)
void InstallExceptionHandler()
{
if (s_veh_handle)
return;
ASSERT(!s_veh_handle);
s_veh_handle = AddVectoredExceptionHandler(TRUE, Handler);
ASSERT(s_veh_handle);
}
@ -98,6 +96,8 @@ void UninstallExceptionHandler()
{
ULONG status = RemoveVectoredExceptionHandler(s_veh_handle);
ASSERT(status);
if (status)
s_veh_handle = nullptr;
}
#elif defined(__APPLE__) && !defined(USE_SIGACTION_ON_APPLE)