Erase balances when delegatecall is seen

This commit is contained in:
Leo Alt
2021-08-25 12:39:26 +02:00
parent 7a0295ec6c
commit a55685c04f
12 changed files with 203 additions and 0 deletions
+1
View File
@@ -591,6 +591,7 @@ void BMC::internalOrExternalFunctionCall(FunctionCall const& _funCall)
{
m_externalFunctionCallHappened = true;
resetStorageVariables();
resetBalances();
}
}
+1
View File
@@ -995,6 +995,7 @@ void CHC::resetContractAnalysis()
void CHC::eraseKnowledge()
{
resetStorageVariables();
resetBalances();
}
void CHC::clearIndices(ContractDefinition const* _contract, FunctionDefinition const* _function)
+7
View File
@@ -2281,6 +2281,13 @@ void SMTEncoder::resetStorageVariables()
});
}
void SMTEncoder::resetBalances()
{
// TODO this should be changed to `balances` only
// when `state` gets more members.
state().newState();
}
void SMTEncoder::resetReferences(VariableDeclaration const& _varDecl)
{
m_context.resetVariables([&](VariableDeclaration const& _var) {
+1
View File
@@ -303,6 +303,7 @@ protected:
void resetStateVariables();
void resetStorageVariables();
void resetMemoryVariables();
void resetBalances();
/// Resets all references/pointers that have the same type or have
/// a subexpression of the same type as _varDecl.
void resetReferences(VariableDeclaration const& _varDecl);