forked from OSchip/llvm-project
[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:
parent
aff73487c9
commit
60c60dd138
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue