forked from OSchip/llvm-project
[asan] Change preprocessor `#if` to regular `if` for CAN_SANITIZE_LEAKS
llvm-svn: 270038
This commit is contained in:
parent
2f2ab5102c
commit
b5cb227b98
|
@ -540,12 +540,12 @@ static void AsanInitInternal() {
|
|||
force_interface_symbols(); // no-op.
|
||||
SanitizerInitializeUnwinder();
|
||||
|
||||
#if CAN_SANITIZE_LEAKS
|
||||
__lsan::InitCommonLsan();
|
||||
if (common_flags()->detect_leaks && common_flags()->leak_check_at_exit) {
|
||||
Atexit(__lsan::DoLeakCheck);
|
||||
if (CAN_SANITIZE_LEAKS) {
|
||||
__lsan::InitCommonLsan();
|
||||
if (common_flags()->detect_leaks && common_flags()->leak_check_at_exit) {
|
||||
Atexit(__lsan::DoLeakCheck);
|
||||
}
|
||||
}
|
||||
#endif // CAN_SANITIZE_LEAKS
|
||||
|
||||
#if CAN_SANITIZE_UB
|
||||
__ubsan::InitAsPlugin();
|
||||
|
@ -553,12 +553,12 @@ static void AsanInitInternal() {
|
|||
|
||||
InitializeSuppressions();
|
||||
|
||||
{
|
||||
#if CAN_SANITIZE_LEAKS
|
||||
if (CAN_SANITIZE_LEAKS) {
|
||||
// LateInitialize() calls dlsym, which can allocate an error string buffer
|
||||
// in the TLS. Let's ignore the allocation to avoid reporting a leak.
|
||||
__lsan::ScopedInterceptorDisabler disabler;
|
||||
#endif
|
||||
Symbolizer::LateInitialize();
|
||||
} else {
|
||||
Symbolizer::LateInitialize();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue