aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-05-24 15:15:17 +0200
committervan Hauser <vh@thc.org>2020-05-24 15:15:17 +0200
commitfc574086ec8beff72a032f73884fb9f1f0d02f47 (patch)
tree6aa35b6589915da05cdbb7e71da1a428490138dc
parent68e66fa92090f7acd3555c8d64ee29ff97334f02 (diff)
downloadafl++-fc574086ec8beff72a032f73884fb9f1f0d02f47.tar.gz
fix cmplog
-rw-r--r--docs/Changelog.md3
-rw-r--r--llvm_mode/cmplog-routines-pass.cc6
2 files changed, 6 insertions, 3 deletions
diff --git a/docs/Changelog.md b/docs/Changelog.md
index 4b6e90e5..6115a0cc 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -28,7 +28,8 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
- LTO whitelist functionality rewritten, now main, _init etc functions
need not to be whitelisted anymore
- fixed crash in compare-transform-pass when strcasemp/strncasecmp was
- tried to be instrumented
+ tried to be instrumented with LTO
+ - fixed crash in cmplog with LTO
- fixed afl-gcc/afl-as that could break on fast systems reusing pids in
the same second
- added lots of dictionaries from oss-fuzz, go-fuzz and Jakub Wilk
diff --git a/llvm_mode/cmplog-routines-pass.cc b/llvm_mode/cmplog-routines-pass.cc
index 623388ba..e05a1843 100644
--- a/llvm_mode/cmplog-routines-pass.cc
+++ b/llvm_mode/cmplog-routines-pass.cc
@@ -164,8 +164,10 @@ bool CmpLogRoutines::hookRtns(Module &M) {
IRB.SetInsertPoint(callInst);
std::vector<Value *> args;
- args.push_back(v1P);
- args.push_back(v2P);
+ Value * v1Pcasted = IRB.CreatePointerCast(v1P, i8PtrTy);
+ Value * v2Pcasted = IRB.CreatePointerCast(v2P, i8PtrTy);
+ args.push_back(v1Pcasted);
+ args.push_back(v2Pcasted);
IRB.CreateCall(cmplogHookFn, args, "tmp");