Skip to content

Commit

Permalink
[hwasan] Enable leak detection in hwasan for Fuchsia by default
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D157127
  • Loading branch information
PiJoules committed Aug 4, 2023
1 parent 849187c commit fe19578
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions compiler-rt/lib/hwasan/hwasan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ static void InitializeFlags() {
cf.clear_shadow_mmap_threshold = 4096 * (SANITIZER_ANDROID ? 2 : 8);
// Sigtrap is used in error reporting.
cf.handle_sigtrap = kHandleSignalExclusive;
// For now only tested on Linux. Other plantforms can be turned on as they
// become ready.
cf.detect_leaks = cf.detect_leaks && SANITIZER_LINUX && !SANITIZER_ANDROID;
// For now only tested on Linux and Fuchsia. Other plantforms can be turned
// on as they become ready.
constexpr bool can_detect_leaks =
(SANITIZER_LINUX && !SANITIZER_ANDROID) || SANITIZER_FUCHSIA;
cf.detect_leaks = cf.detect_leaks && can_detect_leaks;

#if SANITIZER_ANDROID
// Let platform handle other signals. It is better at reporting them then we
Expand Down

0 comments on commit fe19578

Please sign in to comment.