diff options
Diffstat (limited to 'lib/Transforms/Instrumentation/ThreadSanitizer.cpp')
-rw-r--r-- | lib/Transforms/Instrumentation/ThreadSanitizer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Instrumentation/ThreadSanitizer.cpp b/lib/Transforms/Instrumentation/ThreadSanitizer.cpp index c6244a55c9..8536e9a41a 100644 --- a/lib/Transforms/Instrumentation/ThreadSanitizer.cpp +++ b/lib/Transforms/Instrumentation/ThreadSanitizer.cpp @@ -375,7 +375,7 @@ bool ThreadSanitizer::instrumentAtomic(Instruction *I) { const size_t ByteSize = 1 << Idx; const size_t BitSize = ByteSize * 8; Type *Ty = Type::getIntNTy(IRB.getContext(), BitSize); - Type *PtrTy = Ty->getPointerTo(); + Type *PtrTy = Ty->getPointerTo(Addr->getType()); Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy), createOrdering(&IRB, LI->getOrdering())}; CallInst *C = CallInst::Create(TsanAtomicLoad[Idx], @@ -390,7 +390,7 @@ bool ThreadSanitizer::instrumentAtomic(Instruction *I) { const size_t ByteSize = 1 << Idx; const size_t BitSize = ByteSize * 8; Type *Ty = Type::getIntNTy(IRB.getContext(), BitSize); - Type *PtrTy = Ty->getPointerTo(); + Type *PtrTy = Ty->getPointerTo(Addr->getType()); Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy), IRB.CreateIntCast(SI->getValueOperand(), Ty, false), createOrdering(&IRB, SI->getOrdering())}; |