mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Destroy state properly
This commit is contained in:
parent
eb83ebf1bd
commit
f76157bc20
@ -420,6 +420,11 @@ struct SourceState
|
|||||||
|
|
||||||
struct BlockScope
|
struct BlockScope
|
||||||
{
|
{
|
||||||
|
BlockScope() = default;
|
||||||
|
~BlockScope()
|
||||||
|
{
|
||||||
|
variables.clear();
|
||||||
|
}
|
||||||
std::vector<std::pair<SolidityTypePtr, std::string>> variables;
|
std::vector<std::pair<SolidityTypePtr, std::string>> variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -479,6 +484,10 @@ struct ContractState
|
|||||||
uRandDist(std::move(_urd)),
|
uRandDist(std::move(_urd)),
|
||||||
name(_contractName)
|
name(_contractName)
|
||||||
{}
|
{}
|
||||||
|
~ContractState()
|
||||||
|
{
|
||||||
|
functions.clear();
|
||||||
|
}
|
||||||
void addFunction(std::shared_ptr<FunctionState> _function)
|
void addFunction(std::shared_ptr<FunctionState> _function)
|
||||||
{
|
{
|
||||||
functions.emplace(_function);
|
functions.emplace(_function);
|
||||||
@ -629,6 +638,7 @@ struct TestState
|
|||||||
{
|
{
|
||||||
sourceUnitState.clear();
|
sourceUnitState.clear();
|
||||||
contractState.clear();
|
contractState.clear();
|
||||||
|
functionState.clear();
|
||||||
}
|
}
|
||||||
/// Prints test state to @param _os.
|
/// Prints test state to @param _os.
|
||||||
void print(std::ostream& _os) const;
|
void print(std::ostream& _os) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user