Skip to content

Commit f6038cd

Browse files
committed
[compiler-rt][scudo] Simplify TBI checks
Differential Revision: https://reviews.llvm.org/D111080
1 parent b159108 commit f6038cd

File tree

1 file changed

+5
-8
lines changed
  • compiler-rt/lib/scudo/standalone

1 file changed

+5
-8
lines changed

compiler-rt/lib/scudo/standalone/memtag.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,16 @@
1818

1919
namespace scudo {
2020

21-
#if (__clang_major__ >= 12 && defined(__aarch64__) && !defined(__ILP32__)) || \
22-
defined(SCUDO_FUZZ)
23-
2421
// We assume that Top-Byte Ignore is enabled if the architecture supports memory
2522
// tagging. Not all operating systems enable TBI, so we only claim architectural
2623
// support for memory tagging if the operating system enables TBI.
2724
// HWASan uses the top byte for its own purpose and Scudo should not touch it.
28-
#if SCUDO_LINUX && !defined(SCUDO_DISABLE_TBI) && \
29-
!__has_feature(hwaddress_sanitizer)
25+
#if (__clang_major__ >= 12 && defined(__aarch64__) && !defined(__ILP32__) && \
26+
SCUDO_LINUX && \
27+
!defined(SCUDO_DISABLE_TBI) !__has_feature(hwaddress_sanitizer)) || \
28+
defined(SCUDO_FUZZ)
29+
3030
inline constexpr bool archSupportsMemoryTagging() { return true; }
31-
#else
32-
inline constexpr bool archSupportsMemoryTagging() { return false; }
33-
#endif
3431

3532
inline constexpr uptr archMemoryTagGranuleSize() { return 16; }
3633

0 commit comments

Comments
 (0)