fix insertion of __cmplog_rtn_hook
MODIFY
llvm_mode/afl-clang-fast.c
llvm_mode/afl-clang-fast.c
@@ -209,6 +209,8 @@ static void edit_params(u32 argc, char** argv) {
cc_params[cc_par_cnt++] =
alloc_printf("%s/cmplog-routines-pass.so", obj_path);
+ cc_params[cc_par_cnt++] = "-fno-inline";
+
} else {
#ifdef USE_TRACE_PC

MODIFY
llvm_mode/cmplog-routines-pass.cc
llvm_mode/cmplog-routines-pass.cc
@@ -280,9 +280,8 @@ bool CmpLogRoutines::hookRtns(Module &M) {
Value *v1P = callInst->getArgOperand(0),
*v2P = callInst->getArgOperand(1);
- BasicBlock *bb = callInst->getParent();
- BasicBlock::iterator IP = bb->getFirstInsertionPt();
- IRBuilder<> IRB(&*IP);
+ IRBuilder<> IRB(callInst->getParent());
+ IRB.SetInsertPoint(callInst);
std::vector<Value*> args;
args.push_back(v1P);
@@ -290,7 +289,7 @@ bool CmpLogRoutines::hookRtns(Module &M) {
IRB.CreateCall(cmplogHookFn, args, "tmp");
- errs() << callInst->getCalledFunction()->getName() << "\n";
+ // errs() << callInst->getCalledFunction()->getName() << "\n";
}

fix insertion of __cmplog_rtn_hook