mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-15 19:38:09 +00:00
code format
This commit is contained in:
@ -165,16 +165,17 @@ class ModuleSanitizerCoverage {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
ModuleSanitizerCoverage(
|
ModuleSanitizerCoverage(
|
||||||
const SanitizerCoverageOptions &Options = SanitizerCoverageOptions())
|
const SanitizerCoverageOptions &Options = SanitizerCoverageOptions())
|
||||||
: Options(OverrideFromCL(Options)) {
|
: Options(OverrideFromCL(Options)) {
|
||||||
|
|
||||||
/* ,
|
/* ,
|
||||||
const SpecialCaseList * Allowlist = nullptr,
|
const SpecialCaseList * Allowlist = nullptr,
|
||||||
const SpecialCaseList * Blocklist = nullptr)
|
const SpecialCaseList * Blocklist = nullptr)
|
||||||
,
|
,
|
||||||
Allowlist(Allowlist),
|
Allowlist(Allowlist),
|
||||||
Blocklist(Blocklist) {
|
Blocklist(Blocklist) {
|
||||||
*/
|
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,8 +229,8 @@ class ModuleSanitizerCoverage {
|
|||||||
SanitizerCoverageOptions Options;
|
SanitizerCoverageOptions Options;
|
||||||
|
|
||||||
// afl++ START
|
// afl++ START
|
||||||
//const SpecialCaseList * Allowlist;
|
// const SpecialCaseList * Allowlist;
|
||||||
//const SpecialCaseList * Blocklist;
|
// const SpecialCaseList * Blocklist;
|
||||||
uint32_t autodictionary = 1;
|
uint32_t autodictionary = 1;
|
||||||
uint32_t inst = 0;
|
uint32_t inst = 0;
|
||||||
uint32_t afl_global_id = 0;
|
uint32_t afl_global_id = 0;
|
||||||
@ -271,19 +272,20 @@ class ModuleSanitizerCoverageLegacyPass : public ModulePass {
|
|||||||
|
|
||||||
ModuleSanitizerCoverageLegacyPass(
|
ModuleSanitizerCoverageLegacyPass(
|
||||||
const SanitizerCoverageOptions &Options = SanitizerCoverageOptions())
|
const SanitizerCoverageOptions &Options = SanitizerCoverageOptions())
|
||||||
: ModulePass(ID), Options(Options) {
|
: ModulePass(ID), Options(Options) {
|
||||||
/* ,
|
|
||||||
const std::vector<std::string> &AllowlistFiles =
|
/* ,
|
||||||
std::vector<std::string>(),
|
const std::vector<std::string> &AllowlistFiles =
|
||||||
const std::vector<std::string> &BlocklistFiles =
|
std::vector<std::string>(),
|
||||||
std::vector<std::string>())
|
const std::vector<std::string> &BlocklistFiles =
|
||||||
if (AllowlistFiles.size() > 0)
|
std::vector<std::string>())
|
||||||
Allowlist = SpecialCaseList::createOrDie(AllowlistFiles,
|
if (AllowlistFiles.size() > 0)
|
||||||
*vfs::getRealFileSystem());
|
Allowlist = SpecialCaseList::createOrDie(AllowlistFiles,
|
||||||
if (BlocklistFiles.size() > 0)
|
*vfs::getRealFileSystem());
|
||||||
Blocklist = SpecialCaseList::createOrDie(BlocklistFiles,
|
if (BlocklistFiles.size() > 0)
|
||||||
*vfs::getRealFileSystem());
|
Blocklist = SpecialCaseList::createOrDie(BlocklistFiles,
|
||||||
*/
|
*vfs::getRealFileSystem());
|
||||||
|
*/
|
||||||
initializeModuleSanitizerCoverageLegacyPassPass(
|
initializeModuleSanitizerCoverageLegacyPassPass(
|
||||||
*PassRegistry::getPassRegistry());
|
*PassRegistry::getPassRegistry());
|
||||||
|
|
||||||
@ -313,8 +315,8 @@ class ModuleSanitizerCoverageLegacyPass : public ModulePass {
|
|||||||
private:
|
private:
|
||||||
SanitizerCoverageOptions Options;
|
SanitizerCoverageOptions Options;
|
||||||
|
|
||||||
//std::unique_ptr<SpecialCaseList> Allowlist;
|
// std::unique_ptr<SpecialCaseList> Allowlist;
|
||||||
//std::unique_ptr<SpecialCaseList> Blocklist;
|
// std::unique_ptr<SpecialCaseList> Blocklist;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -324,7 +326,7 @@ PreservedAnalyses ModuleSanitizerCoveragePass::run(Module & M,
|
|||||||
ModuleAnalysisManager &MAM) {
|
ModuleAnalysisManager &MAM) {
|
||||||
|
|
||||||
ModuleSanitizerCoverage ModuleSancov(Options);
|
ModuleSanitizerCoverage ModuleSancov(Options);
|
||||||
//Allowlist.get(), Blocklist.get());
|
// Allowlist.get(), Blocklist.get());
|
||||||
auto &FAM = MAM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
|
auto &FAM = MAM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
|
||||||
auto DTCallback = [&FAM](Function &F) -> const DominatorTree * {
|
auto DTCallback = [&FAM](Function &F) -> const DominatorTree * {
|
||||||
|
|
||||||
@ -374,14 +376,14 @@ bool ModuleSanitizerCoverage::instrumentModule(
|
|||||||
Module &M, DomTreeCallback DTCallback, PostDomTreeCallback PDTCallback) {
|
Module &M, DomTreeCallback DTCallback, PostDomTreeCallback PDTCallback) {
|
||||||
|
|
||||||
if (Options.CoverageType == SanitizerCoverageOptions::SCK_None) return false;
|
if (Options.CoverageType == SanitizerCoverageOptions::SCK_None) return false;
|
||||||
/*
|
/*
|
||||||
if (Allowlist &&
|
if (Allowlist &&
|
||||||
!Allowlist->inSection("coverage", "src", M.getSourceFileName()))
|
!Allowlist->inSection("coverage", "src", M.getSourceFileName()))
|
||||||
return false;
|
return false;
|
||||||
if (Blocklist &&
|
if (Blocklist &&
|
||||||
Blocklist->inSection("coverage", "src", M.getSourceFileName()))
|
Blocklist->inSection("coverage", "src", M.getSourceFileName()))
|
||||||
return false;
|
return false;
|
||||||
*/
|
*/
|
||||||
BlockList.clear();
|
BlockList.clear();
|
||||||
valueMap.clear();
|
valueMap.clear();
|
||||||
dictionary.clear();
|
dictionary.clear();
|
||||||
@ -1108,9 +1110,10 @@ void ModuleSanitizerCoverage::instrumentFunction(
|
|||||||
if (F.hasPersonalityFn() &&
|
if (F.hasPersonalityFn() &&
|
||||||
isAsynchronousEHPersonality(classifyEHPersonality(F.getPersonalityFn())))
|
isAsynchronousEHPersonality(classifyEHPersonality(F.getPersonalityFn())))
|
||||||
return;
|
return;
|
||||||
//if (Allowlist && !Allowlist->inSection("coverage", "fun", F.getName()))
|
// if (Allowlist && !Allowlist->inSection("coverage", "fun", F.getName()))
|
||||||
// return;
|
// return;
|
||||||
// if (Blocklist && Blocklist->inSection("coverage", "fun", F.getName())) return;
|
// if (Blocklist && Blocklist->inSection("coverage", "fun", F.getName()))
|
||||||
|
// return;
|
||||||
|
|
||||||
// afl++ START
|
// afl++ START
|
||||||
if (!F.size()) return;
|
if (!F.size()) return;
|
||||||
@ -1471,7 +1474,8 @@ INITIALIZE_PASS_END(ModuleSanitizerCoverageLegacyPass, "sancov",
|
|||||||
false)
|
false)
|
||||||
|
|
||||||
ModulePass *llvm::createModuleSanitizerCoverageLegacyPassPass(
|
ModulePass *llvm::createModuleSanitizerCoverageLegacyPassPass(
|
||||||
const SanitizerCoverageOptions &Options, const std::vector<std::string> &AllowlistFiles,
|
const SanitizerCoverageOptions &Options,
|
||||||
|
const std::vector<std::string> &AllowlistFiles,
|
||||||
const std::vector<std::string> &BlocklistFiles) {
|
const std::vector<std::string> &BlocklistFiles) {
|
||||||
|
|
||||||
return new ModuleSanitizerCoverageLegacyPass(Options);
|
return new ModuleSanitizerCoverageLegacyPass(Options);
|
||||||
|
@ -852,7 +852,8 @@ int main(int argc, char **argv, char **envp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else if (instrument_mode == INSTRUMENT_LTO ||
|
} else if (instrument_mode == INSTRUMENT_LTO ||
|
||||||
instrument_mode == INSTRUMENT_CLASSIC) {
|
|
||||||
|
instrument_mode == INSTRUMENT_CLASSIC) {
|
||||||
|
|
||||||
lto_mode = 1;
|
lto_mode = 1;
|
||||||
callname = "afl-clang-lto";
|
callname = "afl-clang-lto";
|
||||||
|
Reference in New Issue
Block a user