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

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 23:06:35 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));
----------------
arichardson wrote:

Thanks for looking into this, I am very unfamiliar with the hwasan code and was just trying to get the tests to pass. The always zero condition made me think this fix is correct and it would make sense for all accesses to be naturally aligned but I don't yet understand the short tag logic.

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


More information about the llvm-commits mailing list