[llvm] [HWASAN] Use sign extension in memToShadow() and untagPointer() (PR #103727)
Samuel Holland via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 16 15:20:56 PDT 2024
================
@@ -1328,20 +1327,10 @@ Value *HWAddressSanitizer::tagPointer(IRBuilder<> &IRB, Type *Ty,
// Remove tag from an address.
Value *HWAddressSanitizer::untagPointer(IRBuilder<> &IRB, Value *PtrLong) {
+ unsigned SignExtShift = 64 - PointerTagShift;
assert(!UsePageAliases);
- Value *UntaggedPtrLong;
- if (CompileKernel) {
- // Kernel addresses have 0xFF in the most significant byte.
- UntaggedPtrLong =
- IRB.CreateOr(PtrLong, ConstantInt::get(PtrLong->getType(),
- TagMaskByte << PointerTagShift));
----------------
SiFiveHolland wrote:
Correct. X86 LAM requires that bit 63 == bit 56, so bit 63 is not available as a tag bit.
https://github.com/llvm/llvm-project/pull/103727
More information about the llvm-commits
mailing list