From f76157bc203cb0c48d4647e264d3cbcd327b4ff6 Mon Sep 17 00:00:00 2001 From: Bhargava Shastry Date: Wed, 5 May 2021 22:08:45 +0200 Subject: [PATCH] Destroy state properly --- test/tools/ossfuzz/SolidityGenerator.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/tools/ossfuzz/SolidityGenerator.h b/test/tools/ossfuzz/SolidityGenerator.h index 425b85f5e..7027b3812 100644 --- a/test/tools/ossfuzz/SolidityGenerator.h +++ b/test/tools/ossfuzz/SolidityGenerator.h @@ -420,6 +420,11 @@ struct SourceState struct BlockScope { + BlockScope() = default; + ~BlockScope() + { + variables.clear(); + } std::vector> variables; }; @@ -479,6 +484,10 @@ struct ContractState uRandDist(std::move(_urd)), name(_contractName) {} + ~ContractState() + { + functions.clear(); + } void addFunction(std::shared_ptr _function) { functions.emplace(_function); @@ -629,6 +638,7 @@ struct TestState { sourceUnitState.clear(); contractState.clear(); + functionState.clear(); } /// Prints test state to @param _os. void print(std::ostream& _os) const;