diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2016-01-28 00:37:54 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2016-01-28 00:37:54 +0000 |
commit | b73838d55ad6824bb055971ee57d3db186fb6caf (patch) | |
tree | f378aa67bef0420376886b43240bc63a266b1e84 /lib/cfi/cfi.cc | |
parent | e34470ea0b7db132d41715542db49aaaece57387 (diff) |
[cfi] Fix recovery from out-of-bounds vtable error.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259007 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/cfi/cfi.cc')
-rw-r--r-- | lib/cfi/cfi.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/cfi/cfi.cc b/lib/cfi/cfi.cc index 2d22d06c8..8a32ab59d 100644 --- a/lib/cfi/cfi.cc +++ b/lib/cfi/cfi.cc @@ -306,12 +306,14 @@ ALWAYS_INLINE void CfiSlowPathCommon(u64 CallSiteTypeId, void *Ptr, // FIXME: call the ubsan handler if DiagData != nullptr? VReport(1, "CFI: invalid memory region for a check target: %p\n", Ptr); #ifdef CFI_ENABLE_DIAG - if (DiagData) + if (DiagData) { __ubsan_handle_cfi_check_fail( reinterpret_cast<__ubsan::CFICheckFailData *>(DiagData), reinterpret_cast<uptr>(Ptr)); - else + return; + } else { Trap(); + } #else Trap(); #endif @@ -348,7 +350,8 @@ void InitializeFlags() { SetVerbosity(common_flags()->verbosity); - if (Verbosity()) ReportUnrecognizedFlags(); + if (Verbosity()) + ReportUnrecognizedFlags(); if (common_flags()->help) { cfi_parser.PrintFlagDescriptions(); |