[ASAN] NFC: Use addrspace cast for pointers in non-zero addrspace

Pointers in non-zero address spaces need to be address space
casted before appending to the used list.

Reviewed by: vitalybuka

Differential Revision: https://reviews.llvm.org/D101363
This commit is contained in:
Reshabh Sharma 2021-04-29 11:04:23 +05:30
parent aff73487c9
commit 60c60dd138
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ static void appendToUsedList(Module &M, StringRef Name, ArrayRef<GlobalValue *>
Type *Int8PtrTy = llvm::Type::getInt8PtrTy(M.getContext());
for (auto *V : Values) {
Constant *C = ConstantExpr::getBitCast(V, Int8PtrTy);
Constant *C = ConstantExpr::getPointerBitCastOrAddrSpaceCast(V, Int8PtrTy);
if (InitAsSet.insert(C).second)
Init.push_back(C);
}