about summary refs log tree commit diff
path: root/instrumentation/afl-llvm-common.cc
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2021-12-14 10:15:00 +0100
committervanhauser-thc <vh@thc.org>2021-12-14 10:15:09 +0100
commit75ac9c013c6c39eeb3c3e826fa2d368fa09975a4 (patch)
treeb464809ccf86b21e96013ae417ca2ce5d96c7c32 /instrumentation/afl-llvm-common.cc
parentc6bad07d75aa36671ebc32a722566cb145414b08 (diff)
downloadafl++-75ac9c013c6c39eeb3c3e826fa2d368fa09975a4.tar.gz
better instrumentlist filename detection
Diffstat (limited to 'instrumentation/afl-llvm-common.cc')
-rw-r--r--instrumentation/afl-llvm-common.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/instrumentation/afl-llvm-common.cc b/instrumentation/afl-llvm-common.cc
index e5e367a7..9483da83 100644
--- a/instrumentation/afl-llvm-common.cc
+++ b/instrumentation/afl-llvm-common.cc
@@ -401,7 +401,7 @@ static std::string getSourceName(llvm::Function *F) {
 
 }
 
-bool isInInstrumentList(llvm::Function *F) {
+bool isInInstrumentList(llvm::Function *F, std::string Filename) {
 
   bool return_default = true;
 
@@ -448,6 +448,8 @@ bool isInInstrumentList(llvm::Function *F) {
 
       std::string source_file = getSourceName(F);
 
+      if (source_file.empty()) { source_file = Filename; }
+
       if (!source_file.empty()) {
 
         for (std::list<std::string>::iterator it = denyListFiles.begin();
@@ -478,7 +480,7 @@ bool isInInstrumentList(llvm::Function *F) {
         if (!be_quiet)
           WARNF(
               "No debug information found for function %s, will be "
-              "instrumented (recompile with -g -O[1-3]).",
+              "instrumented (recompile with -g -O[1-3] and use a modern llvm).",
               F->getName().str().c_str());
 
       }
@@ -528,6 +530,8 @@ bool isInInstrumentList(llvm::Function *F) {
 
       std::string source_file = getSourceName(F);
 
+      if (source_file.empty()) { source_file = Filename; }
+
       if (!source_file.empty()) {
 
         for (std::list<std::string>::iterator it = allowListFiles.begin();
@@ -563,7 +567,7 @@ bool isInInstrumentList(llvm::Function *F) {
         if (!be_quiet)
           WARNF(
               "No debug information found for function %s, will not be "
-              "instrumented (recompile with -g -O[1-3]).",
+              "instrumented (recompile with -g -O[1-3] and use a modern llvm).",
               F->getName().str().c_str());
         return false;