@@ -25,7 +25,7 @@ static const size_t kShadowScale = 4;
25
25
26
26
static Function *MemStoreFn;
27
27
static Function *MemLoadFn;
28
- static Function *MemMemmoveFn;
28
+ // static Function *MemMemmoveFn;
29
29
static Function *MemMemcpyFn;
30
30
static Function *MemMemsetFn;
31
31
@@ -42,12 +42,12 @@ void initMemFn(Module &M, const std::string NameStore, const std::string NameLo
42
42
MemLoadFn = cast<Function>(M.getOrInsertFunction (NameLoad, IRB.getInt64Ty (), IRB.getInt8PtrTy (),
43
43
IRB.getInt32Ty (), IRB.getInt32Ty ())
44
44
);
45
-
45
+ # if 0
46
46
MemMemmoveFn = checkSanitizerInterfaceFunction( M.getOrInsertFunction(NameMemmove,
47
47
IRB.getVoidTy(), IRB.getInt8PtrTy(),
48
48
IRB.getInt8PtrTy(), IRB.getInt32Ty()
49
49
));
50
-
50
+ # endif
51
51
MemMemcpyFn = checkSanitizerInterfaceFunction ((M.getOrInsertFunction (NameMemcpy,
52
52
IRB.getVoidTy (), IRB.getInt8PtrTy (),
53
53
IRB.getInt8PtrTy (), IRB.getInt32Ty ())
@@ -61,9 +61,10 @@ void initMemFn(Module &M, const std::string NameStore, const std::string NameLo
61
61
62
62
bool instrumentMemIntrinsic (MemIntrinsic *MI) {
63
63
IRBuilder<> IRB (MI);
64
- if (isa<MemTransferInst>(MI)) {
64
+ if (isa<MemTransferInst>(MI) && isa<MemCpyInst>(MI) ) {
65
65
IRB.CreateCall (
66
- isa<MemMoveInst>(MI) ? MemMemmoveFn : MemMemcpyFn,
66
+ MemMemcpyFn,
67
+ // isa<MemMoveInst>(MI) ? MemMemmoveFn : MemMemcpyFn,
67
68
{IRB.CreatePointerCast (MI->getOperand (0 ), IRB.getInt8PtrTy (), " dest_i8ptr_" ),
68
69
IRB.CreatePointerCast (MI->getOperand (1 ), IRB.getInt8PtrTy (), " src_i8ptr_" ),
69
70
IRB.CreateIntCast (MI->getOperand (2 ), IRB.getInt32Ty (), false , " size_int32_" )});
0 commit comments