mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #7650 from ethereum/develop
Merge develop into develop_060
This commit is contained in:
@@ -36,12 +36,37 @@ SMTEncoder::SMTEncoder(smt::EncodingContext& _context):
|
||||
|
||||
bool SMTEncoder::visit(ContractDefinition const& _contract)
|
||||
{
|
||||
solAssert(m_currentContract == nullptr, "");
|
||||
m_currentContract = &_contract;
|
||||
solAssert(m_currentContract, "");
|
||||
|
||||
initializeStateVariables(_contract);
|
||||
for (auto const& node: _contract.subNodes())
|
||||
if (!dynamic_pointer_cast<FunctionDefinition>(node))
|
||||
node->accept(*this);
|
||||
|
||||
return true;
|
||||
vector<FunctionDefinition const*> resolvedFunctions = _contract.definedFunctions();
|
||||
for (auto const& base: _contract.annotation().linearizedBaseContracts)
|
||||
for (auto const& baseFunction: base->definedFunctions())
|
||||
{
|
||||
if (baseFunction->isConstructor())
|
||||
continue;
|
||||
bool overridden = false;
|
||||
for (auto const& function: resolvedFunctions)
|
||||
if (
|
||||
function->name() == baseFunction->name() &&
|
||||
FunctionType(*function).asCallableFunction(false)->
|
||||
hasEqualParameterTypes(*FunctionType(*baseFunction).asCallableFunction(false))
|
||||
)
|
||||
{
|
||||
overridden = true;
|
||||
break;
|
||||
}
|
||||
if (!overridden)
|
||||
resolvedFunctions.push_back(baseFunction);
|
||||
}
|
||||
|
||||
for (auto const& function: resolvedFunctions)
|
||||
function->accept(*this);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void SMTEncoder::endVisit(ContractDefinition const& _contract)
|
||||
@@ -512,6 +537,14 @@ void SMTEncoder::endVisit(FunctionCall const& _funCall)
|
||||
}
|
||||
}
|
||||
|
||||
void SMTEncoder::initContract(ContractDefinition const& _contract)
|
||||
{
|
||||
solAssert(m_currentContract == nullptr, "");
|
||||
m_currentContract = &_contract;
|
||||
|
||||
initializeStateVariables(_contract);
|
||||
}
|
||||
|
||||
void SMTEncoder::initFunction(FunctionDefinition const& _function)
|
||||
{
|
||||
solAssert(m_callStack.empty(), "");
|
||||
|
||||
Reference in New Issue
Block a user