diff options
Diffstat (limited to 'llvm_mode/afl-llvm-common.cc')
-rw-r--r-- | llvm_mode/afl-llvm-common.cc | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/llvm_mode/afl-llvm-common.cc b/llvm_mode/afl-llvm-common.cc index 42f2b774..76de1d0f 100644 --- a/llvm_mode/afl-llvm-common.cc +++ b/llvm_mode/afl-llvm-common.cc @@ -159,13 +159,20 @@ bool isInWhitelist(llvm::Function *F) { * matching if AFL_LLVM_WHITELIST_FNMATCH is set */ if (instFilename.str().length() >= it->length()) { - if (enable_fnmatch && fnmatch((*it).c_str(), - instFilename.str().c_str(), 0) == 0) { + + if (enable_fnmatch && + fnmatch((*it).c_str(), instFilename.str().c_str(), 0) == 0) { + return true; - } else if (!enable_fnmatch && instFilename.str().compare( - instFilename.str().length() - it->length(), - it->length(), *it) == 0) { + + } else if (!enable_fnmatch && + + instFilename.str().compare( + instFilename.str().length() - it->length(), + it->length(), *it) == 0) { + return true; + } } @@ -200,13 +207,20 @@ bool isInWhitelist(llvm::Function *F) { * matching if AFL_LLVM_WHITELIST_FNMATCH is set */ if (instFilename.str().length() >= it->length()) { - if (enable_fnmatch && fnmatch((*it).c_str(), - instFilename.str().c_str(), 0) == 0) { + + if (enable_fnmatch && + fnmatch((*it).c_str(), instFilename.str().c_str(), 0) == 0) { + return true; - } else if (!enable_fnmatch && instFilename.str().compare( - instFilename.str().length() - it->length(), - it->length(), *it) == 0) { + + } else if (!enable_fnmatch && + + instFilename.str().compare( + instFilename.str().length() - it->length(), + it->length(), *it) == 0) { + return true; + } } |