[compiler-rt] fc75c27 - [NFC][HWASAN] Use named const instead of 0xf

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 28 00:45:02 PDT 2023


Author: Vitaly Buka
Date: 2023-04-28T00:44:55-07:00
New Revision: fc75c272f6e45ce3e712fc34668f04fabc4b4763

URL: https://github.com/llvm/llvm-project/commit/fc75c272f6e45ce3e712fc34668f04fabc4b4763
DIFF: https://github.com/llvm/llvm-project/commit/fc75c272f6e45ce3e712fc34668f04fabc4b4763.diff

LOG: [NFC][HWASAN] Use named const instead of 0xf

Added: 
    

Modified: 
    compiler-rt/lib/hwasan/hwasan_checks.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/hwasan/hwasan_checks.h b/compiler-rt/lib/hwasan/hwasan_checks.h
index 616199aeb633..4ffd5246cbd2 100644
--- a/compiler-rt/lib/hwasan/hwasan_checks.h
+++ b/compiler-rt/lib/hwasan/hwasan_checks.h
@@ -166,7 +166,7 @@ __attribute__((always_inline, nodebug)) static void CheckAddressSized(uptr p,
         __builtin_unreachable();
     }
   uptr end = p + sz;
-  uptr tail_sz = end & 0xf;
+  uptr tail_sz = end & (kShadowAlignment - 1);
   if (UNLIKELY(tail_sz != 0 &&
                !PossiblyShortTagMatches(
                    *shadow_last, end & ~(kShadowAlignment - 1), tail_sz))) {


        


More information about the llvm-commits mailing list