about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-02-16 16:45:30 +0100
committervan Hauser <vh@thc.org>2020-02-16 16:45:30 +0100
commit4cccdb89c0112931e451bc0719880813d15d14dc (patch)
tree5482ee0333c4f83c72cc0187865f2a691ab7d86e
parentb98a5de39bfe4e09c218007efe289b49b23b939a (diff)
downloadafl++-4cccdb89c0112931e451bc0719880813d15d14dc.tar.gz
fix for instrim (not the important one)
-rw-r--r--docs/Changelog.md1
-rw-r--r--llvm_mode/LLVMInsTrim.so.cc3
2 files changed, 3 insertions, 1 deletions
diff --git a/docs/Changelog.md b/docs/Changelog.md
index e8b95604..c488b84e 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -22,6 +22,7 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
      - changed execs_per_sec in fuzzer_stats from "current" execs per second
        (which is pointless) to total execs per second
      - bugfix for dictionary insert stage count (fix via Google repo PR)
+  - llvm_mode InsTrim: no pointless instrumentation of 1 block functions
   - afl-clang-fast:
      - show in the help output for which llvm version it was compiled for
      - now does not need to be recompiled between trace-pc and pass
diff --git a/llvm_mode/LLVMInsTrim.so.cc b/llvm_mode/LLVMInsTrim.so.cc
index 995a7217..08d3f68f 100644
--- a/llvm_mode/LLVMInsTrim.so.cc
+++ b/llvm_mode/LLVMInsTrim.so.cc
@@ -175,7 +175,8 @@ struct InsTrim : public ModulePass {
 
     for (Function &F : M) {
 
-      if (!F.size()) { continue; }
+      // if it is external or only contains one basic block: skip it
+      if (F.size() < 2) { continue; }
 
       if (!myWhitelist.empty()) {