Skip to content

Commit 7b7db78

Browse files
committed
[HWASAN][LSAN] Only initialize Symbolizer if leak checking is enabled
Reviewed By: hctim Differential Revision: https://reviews.llvm.org/D144669
1 parent bb58851 commit 7b7db78

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

compiler-rt/lib/hwasan/hwasan.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,9 @@ __attribute__((constructor(0))) void __hwasan_init() {
400400
__ubsan::InitAsPlugin();
401401
#endif
402402

403-
if (CAN_SANITIZE_LEAKS) {
403+
if (CAN_SANITIZE_LEAKS && common_flags()->detect_leaks) {
404404
__lsan::ScopedInterceptorDisabler disabler;
405405
Symbolizer::LateInitialize();
406-
} else {
407-
Symbolizer::LateInitialize();
408406
}
409407

410408
VPrintf(1, "HWAddressSanitizer init done\n");

0 commit comments

Comments
 (0)