[PATCH] D21254: [asan] Do not instrument pointers with address space attributes

Anna Zaks via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 13 10:13:04 PDT 2016


zaks.anna added inline comments.

================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:953
@@ +952,3 @@
+  if (PtrOperand) {
+    Type *PtrTy = cast<PointerType>(PtrOperand->getType()->getScalarType());
+    if (PtrTy->getPointerAddressSpace() != 0)
----------------
kubabrecka wrote:
> Are we sure the cast is *always* valid?  Maybe a dyn_cast + if would be better, but it’s up to you.
I'll double check again, but I think we do always get PointerType here.

================
Comment at: test/Instrumentation/ThreadSanitizer/tsan_address_space_attr.ll:32
@@ +31,2 @@
+}
+; CHECK-NOT: addrspacecast
----------------
kubabrecka wrote:
> kubabrecka wrote:
> > Can we check for the presence of the instrumentation call instead?  The presence or non-presence of “addrspacecast” is a secondary thing.
> (or CHECK-NOT for both if the previous code inserted an invalid addrspacecast)
Can you clarify what you want to test for? 

Codegen crashes on the addrspacecast instruction. I can also test that the load is not instrumented with an additional check.



http://reviews.llvm.org/D21254





More information about the llvm-commits mailing list