mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[SMTChecker] Clear encoding context before engine starts
This commit is contained in:
@@ -49,6 +49,8 @@ void BMC::analyze(SourceUnit const& _source, shared_ptr<Scanner> const& _scanner
|
||||
|
||||
m_scanner = _scanner;
|
||||
|
||||
m_context.clear();
|
||||
|
||||
_source.accept(*this);
|
||||
|
||||
solAssert(m_interface->solvers() > 0, "");
|
||||
|
||||
@@ -44,6 +44,12 @@ void EncodingContext::reset()
|
||||
m_assertions.clear();
|
||||
}
|
||||
|
||||
void EncodingContext::clear()
|
||||
{
|
||||
m_variables.clear();
|
||||
reset();
|
||||
}
|
||||
|
||||
/// Variables.
|
||||
|
||||
shared_ptr<SymbolicVariable> EncodingContext::variable(solidity::VariableDeclaration const& _varDecl)
|
||||
|
||||
@@ -38,8 +38,13 @@ class EncodingContext
|
||||
public:
|
||||
EncodingContext(std::shared_ptr<SolverInterface> _solver);
|
||||
|
||||
/// Resets the entire context.
|
||||
/// Resets the entire context except for symbolic variables which stay
|
||||
/// alive because of state variables and inlined function calls.
|
||||
/// To be used in the beginning of a root function visit.
|
||||
void reset();
|
||||
/// Clears the entire context, erasing everything.
|
||||
/// To be used before a model checking engine starts.
|
||||
void clear();
|
||||
|
||||
/// Forwards variable creation to the solver.
|
||||
Expression newVariable(std::string _name, SortPointer _sort)
|
||||
|
||||
Reference in New Issue
Block a user