Skip to content

Commit

Permalink
[ASAN] NFC: Use addrspace cast for pointers in non-zero addrspace
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rksharma-yymd committed Apr 29, 2021
1 parent aff7348 commit 60c60dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Utils/ModuleUtils.cpp
Expand Up @@ -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);
}
Expand Down

0 comments on commit 60c60dd

Please sign in to comment.