[asan] Change preprocessor `#if` to regular `if` for CAN_SANITIZE_LEAKS

llvm-svn: 270038
This commit is contained in:
Kuba Brecka 2016-05-19 10:43:51 +00:00
parent 2f2ab5102c
commit b5cb227b98
1 changed files with 8 additions and 8 deletions

View File

@ -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();
}