aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2021-10-17 13:20:32 +0200
committervanhauser-thc <vh@thc.org>2021-10-17 13:20:32 +0200
commite8cf04c90d730381eab3ef6c64ab957ab5ebc400 (patch)
treeaa4c70eea466e208df9ba4d678c49122ddaa8245
parented10f3783bd8fab33ab5750f56bf87ed008f28ed (diff)
downloadafl++-e8cf04c90d730381eab3ef6c64ab957ab5ebc400.tar.gz
fix
-rw-r--r--instrumentation/cmplog-routines-pass.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/instrumentation/cmplog-routines-pass.cc b/instrumentation/cmplog-routines-pass.cc
index 56f1a083..3d6467ba 100644
--- a/instrumentation/cmplog-routines-pass.cc
+++ b/instrumentation/cmplog-routines-pass.cc
@@ -482,8 +482,7 @@ bool CmpLogRoutines::hookRtns(Module &M) {
for (auto &callInst : Strcmp) {
- Value *v1P = callInst->getArgOperand(0), *v2P = callInst->getArgOperand(1),
- *v3P = callInst->getArgOperand(2);
+ Value *v1P = callInst->getArgOperand(0), *v2P = callInst->getArgOperand(1);
IRBuilder<> IRB2(callInst->getParent());
IRB2.SetInsertPoint(callInst);
@@ -498,10 +497,8 @@ bool CmpLogRoutines::hookRtns(Module &M) {
std::vector<Value *> args;
Value * v1Pcasted = IRB.CreatePointerCast(v1P, i8PtrTy);
Value * v2Pcasted = IRB.CreatePointerCast(v2P, i8PtrTy);
- Value * v3Pcasted = IRB.CreateZExtOrBitCast(v3P, Int32Ty);
args.push_back(v1Pcasted);
args.push_back(v2Pcasted);
- args.push_back(v3Pcasted);
IRB.CreateCall(cmplogHookFnStr, args);
@@ -527,7 +524,7 @@ bool CmpLogRoutines::hookRtns(Module &M) {
std::vector<Value *> args;
Value * v1Pcasted = IRB.CreatePointerCast(v1P, i8PtrTy);
Value * v2Pcasted = IRB.CreatePointerCast(v2P, i8PtrTy);
- Value * v3Pcasted = IRB.CreateZExtOrBitCast(v3P, Int32Ty);
+ Value * v3Pcasted = IRB.CreateTruncOrBitCast(v3P, Int32Ty);
args.push_back(v1Pcasted);
args.push_back(v2Pcasted);
args.push_back(v3Pcasted);