diff options
author | Marcos Pividori <mpividori@google.com> | 2017-02-02 23:01:51 +0000 |
---|---|---|
committer | Marcos Pividori <mpividori@google.com> | 2017-02-02 23:01:51 +0000 |
commit | 48eacb03179d302ffd4b4e7670965993cff82cd0 (patch) | |
tree | f1e2122f0bc059089b8de4368b82fd40d7e12c7f /lib/asan/asan_win.cc | |
parent | 424390894b6a45582d52215b4898995431e8c9aa (diff) |
[sanitizer] Move exception code to sanitizer_common.
Differential Revision: https://reviews.llvm.org/D29458
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293955 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_win.cc')
-rw-r--r-- | lib/asan/asan_win.cc | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/lib/asan/asan_win.cc b/lib/asan/asan_win.cc index a41620ed3..d77d9d643 100644 --- a/lib/asan/asan_win.cc +++ b/lib/asan/asan_win.cc @@ -27,6 +27,7 @@ #include "asan_mapping.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_mutex.h" +#include "sanitizer_common/sanitizer_win.h" #include "sanitizer_common/sanitizer_win_defs.h" using namespace __asan; // NOLINT @@ -236,33 +237,6 @@ void InitializePlatformExceptionHandlers() { static LPTOP_LEVEL_EXCEPTION_FILTER default_seh_handler; -// Check based on flags if we should report this exception. -static bool ShouldReportDeadlyException(unsigned code) { - switch (code) { - case EXCEPTION_ACCESS_VIOLATION: - case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: - case EXCEPTION_STACK_OVERFLOW: - case EXCEPTION_DATATYPE_MISALIGNMENT: - case EXCEPTION_IN_PAGE_ERROR: - return common_flags()->handle_segv; - case EXCEPTION_ILLEGAL_INSTRUCTION: - case EXCEPTION_PRIV_INSTRUCTION: - case EXCEPTION_BREAKPOINT: - return common_flags()->handle_sigill; - case EXCEPTION_FLT_DENORMAL_OPERAND: - case EXCEPTION_FLT_DIVIDE_BY_ZERO: - case EXCEPTION_FLT_INEXACT_RESULT: - case EXCEPTION_FLT_INVALID_OPERATION: - case EXCEPTION_FLT_OVERFLOW: - case EXCEPTION_FLT_STACK_CHECK: - case EXCEPTION_FLT_UNDERFLOW: - case EXCEPTION_INT_DIVIDE_BY_ZERO: - case EXCEPTION_INT_OVERFLOW: - return common_flags()->handle_sigfpe; - } - return false; -} - // Return the textual name for this exception. const char *DescribeSignalOrException(int signo) { unsigned code = signo; @@ -296,7 +270,7 @@ long __asan_unhandled_exception_filter(EXCEPTION_POINTERS *info) { CONTEXT *context = info->ContextRecord; // Continue the search if the signal wasn't deadly. - if (!ShouldReportDeadlyException(exception_record->ExceptionCode)) + if (!IsHandledDeadlyException(exception_record->ExceptionCode)) return EXCEPTION_CONTINUE_SEARCH; // FIXME: Handle EXCEPTION_STACK_OVERFLOW here. |