From e09b3be411b0cfbf560edd4e089b2810c1ba2685 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Tue, 7 Mar 2023 22:26:07 -0800 Subject: [PATCH] [fuzzer] Make sure we never delete Fuzzer --- compiler-rt/lib/fuzzer/FuzzerInternal.h | 4 ++-- compiler-rt/lib/fuzzer/FuzzerLoop.cpp | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler-rt/lib/fuzzer/FuzzerInternal.h b/compiler-rt/lib/fuzzer/FuzzerInternal.h index a732ca87..4194bc6 100644 --- a/compiler-rt/lib/fuzzer/FuzzerInternal.h +++ b/compiler-rt/lib/fuzzer/FuzzerInternal.h @@ -29,12 +29,12 @@ namespace fuzzer { using namespace std::chrono; -class Fuzzer { +class Fuzzer final { public: Fuzzer(UserCallback CB, InputCorpus &Corpus, MutationDispatcher &MD, FuzzingOptions Options); - ~Fuzzer(); + ~Fuzzer() = delete; void Loop(std::vector &CorporaFiles); void ReadAndExecuteSeedCorpora(std::vector &CorporaFiles); void MinimizeCrashLoop(const Unit &U); diff --git a/compiler-rt/lib/fuzzer/FuzzerLoop.cpp b/compiler-rt/lib/fuzzer/FuzzerLoop.cpp index 3609c7f..121f781 100644 --- a/compiler-rt/lib/fuzzer/FuzzerLoop.cpp +++ b/compiler-rt/lib/fuzzer/FuzzerLoop.cpp @@ -160,8 +160,6 @@ Fuzzer::Fuzzer(UserCallback CB, InputCorpus &Corpus, MutationDispatcher &MD, memset(BaseSha1, 0, sizeof(BaseSha1)); } -Fuzzer::~Fuzzer() {} - void Fuzzer::AllocateCurrentUnitData() { if (CurrentUnitData || MaxInputLen == 0) return; -- 2.7.4