[llvm] [ASan][AMDGPU] Fix Assertion Failure. (PR #78710)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 23 16:56:38 PST 2024


================
@@ -1255,7 +1255,8 @@ void AddressSanitizer::instrumentMemIntrinsic(MemIntrinsic *MI) {
   InstrumentationIRBuilder IRB(MI);
   if (isa<MemTransferInst>(MI)) {
     IRB.CreateCall(isa<MemMoveInst>(MI) ? AsanMemmove : AsanMemcpy,
-                   {MI->getOperand(0), MI->getOperand(1),
+                   {IRB.CreateAddrSpaceCast(MI->getOperand(0), PtrTy),
+                    IRB.CreateAddrSpaceCast(MI->getOperand(1), PtrTy),
----------------
arsenm wrote:

> > It will be needed for any memory intrinsic
> 
> Logically we should never see an attempt to set memory with a pointer to constant memory, but I think we need to handle memset otherwise.

The "constant" part here isn't what matters, it's the non-0 address space 

https://github.com/llvm/llvm-project/pull/78710


More information about the llvm-commits mailing list