[compiler-rt] e09b3be - [fuzzer] Make sure we never delete Fuzzer

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 22:27:04 PST 2023


Author: Vitaly Buka
Date: 2023-03-07T22:26:07-08:00
New Revision: e09b3be411b0cfbf560edd4e089b2810c1ba2685

URL: https://github.com/llvm/llvm-project/commit/e09b3be411b0cfbf560edd4e089b2810c1ba2685
DIFF: https://github.com/llvm/llvm-project/commit/e09b3be411b0cfbf560edd4e089b2810c1ba2685.diff

LOG: [fuzzer] Make sure we never delete Fuzzer

Added: 
    

Modified: 
    compiler-rt/lib/fuzzer/FuzzerInternal.h
    compiler-rt/lib/fuzzer/FuzzerLoop.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/fuzzer/FuzzerInternal.h b/compiler-rt/lib/fuzzer/FuzzerInternal.h
index a732ca87b0f3..4194bc621341 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<SizedFile> &CorporaFiles);
   void ReadAndExecuteSeedCorpora(std::vector<SizedFile> &CorporaFiles);
   void MinimizeCrashLoop(const Unit &U);

diff  --git a/compiler-rt/lib/fuzzer/FuzzerLoop.cpp b/compiler-rt/lib/fuzzer/FuzzerLoop.cpp
index 3609c7fcd8a5..121f781c31a5 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;


        


More information about the llvm-commits mailing list