mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Erase balances when delegatecall is seen
This commit is contained in:
@@ -591,6 +591,7 @@ void BMC::internalOrExternalFunctionCall(FunctionCall const& _funCall)
|
||||
{
|
||||
m_externalFunctionCallHappened = true;
|
||||
resetStorageVariables();
|
||||
resetBalances();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -995,6 +995,7 @@ void CHC::resetContractAnalysis()
|
||||
void CHC::eraseKnowledge()
|
||||
{
|
||||
resetStorageVariables();
|
||||
resetBalances();
|
||||
}
|
||||
|
||||
void CHC::clearIndices(ContractDefinition const* _contract, FunctionDefinition const* _function)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user