Skip to content

Commit

Permalink
[asan] Fix compiler warnings.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208769 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
eugenis committed May 14, 2014
1 parent eb949e0 commit 54952a3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/Transforms/Instrumentation/AddressSanitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,15 +606,14 @@ Value *AddressSanitizer::memToShadow(Value *Shadow, IRBuilder<> &IRB) {
// Instrument memset/memmove/memcpy
void AddressSanitizer::instrumentMemIntrinsic(MemIntrinsic *MI) {
IRBuilder<> IRB(MI);
Instruction *Call = nullptr;
if (isa<MemTransferInst>(MI)) {
Call = IRB.CreateCall3(
IRB.CreateCall3(
isa<MemMoveInst>(MI) ? AsanMemmove : AsanMemcpy,
IRB.CreatePointerCast(MI->getOperand(0), IRB.getInt8PtrTy()),
IRB.CreatePointerCast(MI->getOperand(1), IRB.getInt8PtrTy()),
IRB.CreateIntCast(MI->getOperand(2), IntptrTy, false));
} else if (isa<MemSetInst>(MI)) {
Call = IRB.CreateCall3(
IRB.CreateCall3(
AsanMemset,
IRB.CreatePointerCast(MI->getOperand(0), IRB.getInt8PtrTy()),
IRB.CreateIntCast(MI->getOperand(1), IRB.getInt32Ty(), false),
Expand Down Expand Up @@ -740,8 +739,7 @@ void AddressSanitizer::instrumentMop(Instruction *I, bool UseCalls) {
Value *Size = ConstantInt::get(IntptrTy, TypeSize / 8);
Value *AddrLong = IRB.CreatePointerCast(Addr, IntptrTy);
if (UseCalls) {
CallInst *Check =
IRB.CreateCall2(AsanMemoryAccessCallbackSized[IsWrite], AddrLong, Size);
IRB.CreateCall2(AsanMemoryAccessCallbackSized[IsWrite], AddrLong, Size);
} else {
Value *LastByte = IRB.CreateIntToPtr(
IRB.CreateAdd(AddrLong, ConstantInt::get(IntptrTy, TypeSize / 8 - 1)),
Expand Down

0 comments on commit 54952a3

Please sign in to comment.