diff options
author | Dominik Maier <domenukk@gmail.com> | 2020-01-27 13:30:11 +0100 |
---|---|---|
committer | Dominik Maier <domenukk@gmail.com> | 2020-01-27 13:30:11 +0100 |
commit | 9bf8f794968483055bcde46f3df1c8238fae7f76 (patch) | |
tree | 15a41fad96095b0e49bb5f9c3cd76f20251ddef1 /llvm_mode/afl-llvm-pass.so.cc | |
parent | 38232979587b6c37b024f22849b311d7e6962edf (diff) | |
parent | 17f0aad0f0322a0c56040b3bd93d2bf020a3f3fb (diff) | |
download | afl++-9bf8f794968483055bcde46f3df1c8238fae7f76.tar.gz |
Merge branch 'master' of github.com:vanhauser-thc/AFLplusplus
Diffstat (limited to 'llvm_mode/afl-llvm-pass.so.cc')
-rw-r--r-- | llvm_mode/afl-llvm-pass.so.cc | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/llvm_mode/afl-llvm-pass.so.cc b/llvm_mode/afl-llvm-pass.so.cc index 0b3db4ed..15cc6127 100644 --- a/llvm_mode/afl-llvm-pass.so.cc +++ b/llvm_mode/afl-llvm-pass.so.cc @@ -75,6 +75,28 @@ class AFLCoverage : public ModulePass { } + // ripped from aflgo + static bool isBlacklisted(const Function *F) { + + static const SmallVector<std::string, 4> Blacklist = { + + "asan.", + "llvm.", + "sancov.", + "__ubsan_handle_", + + }; + + for (auto const &BlacklistFunc : Blacklist) { + + if (F->getName().startswith(BlacklistFunc)) { return true; } + + } + + return false; + + } + bool runOnModule(Module &M) override; // StringRef getPassName() const override { @@ -156,13 +178,11 @@ bool AFLCoverage::runOnModule(Module &M) { /* Instrument all the things! */ - const char *IntrinsicPrefix = "llvm."; int inst_blocks = 0; for (auto &F : M) { - auto Fname = F.getName(); - if (Fname.startswith(IntrinsicPrefix)) continue; + if (isBlacklisted(&F)) continue; for (auto &BB : F) { @@ -377,6 +397,7 @@ bool AFLCoverage::runOnModule(Module &M) { inst_blocks++; } + } /* Say something nice. */ |