Skip to content

Commit 60c60dd

Browse files
committed
[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
1 parent aff7348 commit 60c60dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/Utils/ModuleUtils.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static void appendToUsedList(Module &M, StringRef Name, ArrayRef<GlobalValue *>
8989

9090
Type *Int8PtrTy = llvm::Type::getInt8PtrTy(M.getContext());
9191
for (auto *V : Values) {
92-
Constant *C = ConstantExpr::getBitCast(V, Int8PtrTy);
92+
Constant *C = ConstantExpr::getPointerBitCastOrAddrSpaceCast(V, Int8PtrTy);
9393
if (InitAsSet.insert(C).second)
9494
Init.push_back(C);
9595
}

0 commit comments

Comments
 (0)