[llvm] [HWASAN] Use sign extension in memToShadow() and untagPointer() (PR #103727)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 16 14:22:39 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));
----------------
topperc wrote:
X86's TagMaskByte is 0x3F(6 bits) even though PointerTagShift is 57. Does that mean the original code doesn't set bit 63?
https://github.com/llvm/llvm-project/pull/103727
More information about the llvm-commits
mailing list