[llvm] [HWASAN] Use sign extension in memToShadow() and untagPointer() (PR #103727)
Samuel Holland via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 9 15:38:19 PST 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:
Yes, for x86, it will copy bit 56 to bit 63. Is this a problem?
https://github.com/llvm/llvm-project/pull/103727
More information about the llvm-commits
mailing list