aboutsummaryrefslogtreecommitdiff
path: root/instrumentation/cmplog-routines-pass.cc
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-01-22 16:41:31 +0100
committervan Hauser <vh@thc.org>2021-01-22 16:41:31 +0100
commit1c19804834d2ea4f169be0a99b8ce493a2f10167 (patch)
treec7a2a3301cc83b8de973d49cdeba758ac5b5e9e2 /instrumentation/cmplog-routines-pass.cc
parent9ed533a0e3908a40e3abc28b95c6f5bd4e413c44 (diff)
downloadAFLplusplus-1c19804834d2ea4f169be0a99b8ce493a2f10167.tar.gz
fix for cmplog stdstring
Diffstat (limited to 'instrumentation/cmplog-routines-pass.cc')
-rw-r--r--instrumentation/cmplog-routines-pass.cc33
1 files changed, 21 insertions, 12 deletions
diff --git a/instrumentation/cmplog-routines-pass.cc b/instrumentation/cmplog-routines-pass.cc
index 9f19b062..a5992c9a 100644
--- a/instrumentation/cmplog-routines-pass.cc
+++ b/instrumentation/cmplog-routines-pass.cc
@@ -226,26 +226,32 @@ bool CmpLogRoutines::hookRtns(Module &M) {
FT->getParamType(1)->isPointerTy();
bool isLlvmStdStringStdString =
- Callee->getName().find("_ZNSt3__1eqINS") != std::string::npos &&
- Callee->getName().find("_12basic_stringIcNS_11char_traits") !=
- std::string::npos &&
+ Callee->getName().find("_ZNSt3__1eqI") != std::string::npos &&
+ Callee->getName().find("_12basic_stringI") != std::string::npos &&
+ Callee->getName().find("_11char_traits") != std::string::npos &&
FT->getNumParams() >= 2 && FT->getParamType(0)->isPointerTy() &&
FT->getParamType(1)->isPointerTy();
bool isLlvmStdStringCString =
- Callee->getName().find("ZNSt3__1eqIcNS") != std::string::npos &&
+ Callee->getName().find("_ZNSt3__1eqI") != std::string::npos &&
Callee->getName().find("_12basic_stringI") != std::string::npos &&
FT->getNumParams() >= 2 && FT->getParamType(0)->isPointerTy() &&
FT->getParamType(1)->isPointerTy();
/*
- fprintf(stderr, "F:%s C:%s argc:%u\n",
- F.getName().str().c_str(), Callee->getName().str().c_str(),
- FT->getNumParams()); fprintf(stderr, "ptr0:%u ptr1:%u ptr2:%u\n",
- FT->getParamType(0)->isPointerTy(),
- FT->getParamType(1)->isPointerTy(),
- FT->getNumParams() > 2 ? FT->getParamType(2)->isPointerTy()
- : 22 );
+ {
+
+ fprintf(stderr, "F:%s C:%s argc:%u\n",
+ F.getName().str().c_str(),
+ Callee->getName().str().c_str(), FT->getNumParams());
+ fprintf(stderr, "ptr0:%u ptr1:%u ptr2:%u\n",
+ FT->getParamType(0)->isPointerTy(),
+ FT->getParamType(1)->isPointerTy(),
+ FT->getNumParams() > 2 ?
+ FT->getParamType(2)->isPointerTy() : 22 );
+
+ }
+
*/
if (isGccStdStringCString || isGccStdStringStdString ||
@@ -269,7 +275,10 @@ bool CmpLogRoutines::hookRtns(Module &M) {
}
- if (!calls.size()) return false;
+ if (!calls.size() && !gccStdStd.size() && !gccStdC.size() &&
+ !llvmStdStd.size() && !llvmStdC.size())
+ return false;
+
/*
if (!be_quiet)
errs() << "Hooking " << calls.size()