mirror of
https://github.com/intel/llvm.git
synced 2026-02-05 04:04:23 +08:00
[compiler-rt][asan][win] Intercept exceptions for i686 MinGW
The i686-w64-windows-gnu target does not use SEH (which MSVC uses), but DWARF-2 exception handling or possibly sjlj depending on the toolchain build options. On this target we have to actually intercept functions in libc++ and libunwind which handles throwing exceptions. This fixes the `TestCases/intercept-rethrow-exception.cpp` test. The x86_64-w64-windows-gnu target already works because it uses SEH which is handled by intercepting RaiseException, so this change does not affect x86_64. Depends on https://reviews.llvm.org/D148990 Differential Revision: https://reviews.llvm.org/D148991
This commit is contained in:
@@ -78,8 +78,8 @@ void InitializePlatformInterceptors();
|
||||
# define ASAN_INTERCEPT___LONGJMP_CHK 0
|
||||
#endif
|
||||
|
||||
#if ASAN_HAS_EXCEPTIONS && !SANITIZER_WINDOWS && !SANITIZER_SOLARIS && \
|
||||
!SANITIZER_NETBSD
|
||||
#if ASAN_HAS_EXCEPTIONS && !SANITIZER_SOLARIS && !SANITIZER_NETBSD && \
|
||||
(!SANITIZER_WINDOWS || (defined(__MINGW32__) && defined(__i386__)))
|
||||
# define ASAN_INTERCEPT___CXA_THROW 1
|
||||
# define ASAN_INTERCEPT___CXA_RETHROW_PRIMARY_EXCEPTION 1
|
||||
# if defined(_GLIBCXX_SJLJ_EXCEPTIONS) || (SANITIZER_IOS && defined(__arm__))
|
||||
|
||||
@@ -898,6 +898,10 @@ static void **InterestingDLLsAvailable() {
|
||||
"msvcr120.dll", // VS2013
|
||||
"vcruntime140.dll", // VS2015
|
||||
"ucrtbase.dll", // Universal CRT
|
||||
#if (defined(__MINGW32__) && defined(__i386__))
|
||||
"libc++.dll", // libc++
|
||||
"libunwind.dll", // libunwind
|
||||
#endif
|
||||
// NTDLL should go last as it exports some functions that we should
|
||||
// override in the CRT [presumably only used internally].
|
||||
"ntdll.dll", NULL};
|
||||
|
||||
Reference in New Issue
Block a user