forked from OSchip/llvm-project
[cfi] Disable vtable diagnostics when no cxxabi.
This should fix the build on Mac 10.8 and earlier. llvm-svn: 258988
This commit is contained in:
parent
6b6dcc448a
commit
7cced3ba82
|
@ -23,9 +23,14 @@ include_directories(..)
|
|||
|
||||
set(UBSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
|
||||
append_no_rtti_flag(UBSAN_CFLAGS)
|
||||
append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_CFLAGS)
|
||||
|
||||
set(UBSAN_STANDALONE_CFLAGS ${SANITIZER_COMMON_CFLAGS})
|
||||
append_no_rtti_flag(UBSAN_STANDALONE_CFLAGS)
|
||||
append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_STANDALONE_CFLAGS)
|
||||
|
||||
set(UBSAN_CXXFLAGS ${SANITIZER_COMMON_CFLAGS})
|
||||
append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_CXXFLAGS)
|
||||
|
||||
add_custom_target(ubsan)
|
||||
|
||||
|
|
|
@ -548,9 +548,16 @@ static void handleCFIBadIcall(CFICheckFailData *Data, ValueHandle Function,
|
|||
}
|
||||
|
||||
namespace __ubsan {
|
||||
#ifdef UBSAN_CAN_USE_CXXABI
|
||||
SANITIZER_WEAK_ATTRIBUTE
|
||||
void HandleCFIBadType(CFICheckFailData *Data, ValueHandle Vtable,
|
||||
ReportOptions Opts);
|
||||
#else
|
||||
static void HandleCFIBadType(CFICheckFailData *Data, ValueHandle Vtable,
|
||||
ReportOptions Opts) {
|
||||
Die();
|
||||
}
|
||||
#endif
|
||||
} // namespace __ubsan
|
||||
|
||||
void __ubsan::__ubsan_handle_cfi_check_fail(CFICheckFailData *Data,
|
||||
|
|
|
@ -70,6 +70,8 @@
|
|||
// RUN: %expect_crash %t __v 2>&1 | FileCheck %s --check-prefix=ICALL-NODIAG --check-prefix=CAST-NODIAG \
|
||||
// RUN: --check-prefix=VCALL-NODIAG --check-prefix=VCALL-FATAL
|
||||
|
||||
// REQUIRES: cxxabi
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
|
Loading…
Reference in New Issue