about summary refs log tree commit diff
path: root/llvm_mode/afl-llvm-lto-whitelist.so.cc
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-04-25 17:53:38 +0200
committervan Hauser <vh@thc.org>2020-04-25 17:53:38 +0200
commit0c3d06c41e2848f53db5caa881d624df87cec0d2 (patch)
treee91f65c47afe18e9c78f2b603ed59342fc191e64 /llvm_mode/afl-llvm-lto-whitelist.so.cc
parent07db922024a1faf5543f9d83ce683024e99526ce (diff)
downloadafl++-0c3d06c41e2848f53db5caa881d624df87cec0d2.tar.gz
refactored whitelist and blacklist in llvm_mode
Diffstat (limited to 'llvm_mode/afl-llvm-lto-whitelist.so.cc')
-rw-r--r--llvm_mode/afl-llvm-lto-whitelist.so.cc22
1 files changed, 2 insertions, 20 deletions
diff --git a/llvm_mode/afl-llvm-lto-whitelist.so.cc b/llvm_mode/afl-llvm-lto-whitelist.so.cc
index 045ff6c4..5e157472 100644
--- a/llvm_mode/afl-llvm-lto-whitelist.so.cc
+++ b/llvm_mode/afl-llvm-lto-whitelist.so.cc
@@ -46,6 +46,8 @@
 #include "llvm/Transforms/IPO/PassManagerBuilder.h"
 #include "llvm/IR/CFG.h"
 
+#include "afl-llvm-common.h"
+
 using namespace llvm;
 
 namespace {
@@ -86,26 +88,6 @@ class AFLwhitelist : public ModulePass {
 
   }
 
-  // ripped from aflgo
-  static bool isBlacklisted(const Function *F) {
-
-    static const SmallVector<std::string, 5> Blacklist = {
-
-        "asan.", "llvm.",      "sancov.", "__ubsan_handle_", "ign.", "__afl_",
-        "_fini", "__libc_csu", "__asan",  "__msan",          "msan."
-
-    };
-
-    for (auto const &BlacklistFunc : Blacklist) {
-
-      if (F->getName().startswith(BlacklistFunc)) { return true; }
-
-    }
-
-    return false;
-
-  }
-
   bool runOnModule(Module &M) override;
 
   // StringRef getPassName() const override {