[compiler-rt] [llvm] [ASan] Correctly handle vectorized pointer sub/cmp for `invalid-pointer-pair` (PR #213546)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 15 18:44:54 PDT 2026
================
@@ -1698,16 +1698,38 @@ bool AddressSanitizer::GlobalIsLinkerInitialized(GlobalVariable *G) {
return true;
}
-void AddressSanitizer::instrumentPointerComparisonOrSubtraction(
+bool AddressSanitizer::instrumentPointerComparisonOrSubtraction(
Instruction *I, RuntimeCallInserter &RTCI) {
IRBuilder<> IRB(I);
FunctionCallee F = isa<ICmpInst>(I) ? AsanPtrCmpFunction : AsanPtrSubFunction;
Value *Param[2] = {I->getOperand(0), I->getOperand(1)};
- for (Value *&i : Param) {
- if (i->getType()->isPointerTy())
- i = IRB.CreatePointerCast(i, IntptrTy);
+
+ if (const auto *Ty = Param[0]->getType(); Ty->isVectorTy()) {
+ const auto *VTy = dyn_cast<FixedVectorType>(Ty);
+ // Skip scalable vectors
----------------
flovent wrote:
Done, i changed it to `// TODO: Add support for scalable vectors if possible.`
https://github.com/llvm/llvm-project/pull/213546
More information about the llvm-commits
mailing list