[PATCH] D44699: [HWASan] Port HWASan to Linux x86-64 (LLVM)

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 21 16:37:13 PDT 2018


eugenis added inline comments.


================
Comment at: lib/Transforms/Instrumentation/HWAddressSanitizer.cpp:369
   Value *AddrLong = IRB.CreatePointerCast(Addr, IntptrTy);
+  Value *UntaggedPtr = TargetTriple.getArch() == Triple::x86_64
+      ? IRB.CreateIntToPtr(untagPointer(IRB, AddrLong), Addr->getType())
----------------
the condition should be not-arm64, not is-x86.


================
Comment at: lib/Transforms/Instrumentation/HWAddressSanitizer.cpp:389
+  if (UntaggedPtr)
+    I->setOperand(getPointerOperandIndex(I), UntaggedPtr);
+
----------------
I'd move untagging to a separate function. It does not need to be tied to tag checking. In the future we'll probably want to untag other stuff, like pointers in external function call arguments.



================
Comment at: test/Instrumentation/HWAddressSanitizer/X86/basic.ll:1
+; Test basic address sanitizer instrumentation.
+;
----------------
That's a lot of copy-paste, and most of it is covered by aarch64 tests.
Lets only test the parts that differ: trap instruction sequence (one or two cases would be enough), and pointer untagging.


Repository:
  rL LLVM

https://reviews.llvm.org/D44699





More information about the llvm-commits mailing list