[compiler-rt] [hwasan] Fix DCHECK with COMPILER_RT_DEBUG=ON (PR #84612)

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 17:33:19 PDT 2024


================
@@ -140,7 +140,7 @@ __attribute__((always_inline, nodebug)) static inline uptr ShortTagSize(
 
 __attribute__((always_inline, nodebug)) static inline bool
 PossiblyShortTagMatches(tag_t mem_tag, uptr ptr, uptr sz) {
-  DCHECK(IsAligned(ptr, kShadowAlignment));
+  DCHECK(IsAligned(ptr, sz));
----------------
fmayer wrote:

No, that is not correct. It is actually `| (kShadowAlignment - 1)` not `&`, to access the last byte of the last granule (to get the short granule tag).

https://github.com/llvm/llvm-project/pull/84612


More information about the llvm-commits mailing list