mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Visit structs only once.
This commit is contained in:
parent
96c09fcbcd
commit
5ced3af3a0
@ -64,8 +64,10 @@ bool TypeChecker::visit(ContractDefinition const& _contract)
|
|||||||
{
|
{
|
||||||
m_scope = &_contract;
|
m_scope = &_contract;
|
||||||
|
|
||||||
// We force our own visiting order here.
|
// We force our own visiting order here. The structs have to be excluded below.
|
||||||
//@TODO structs will be visited again below, but it is probably fine.
|
set<ASTNode const*> visited;
|
||||||
|
for (auto const& s: _contract.definedStructs())
|
||||||
|
visited.insert(s);
|
||||||
ASTNode::listAccept(_contract.definedStructs(), *this);
|
ASTNode::listAccept(_contract.definedStructs(), *this);
|
||||||
ASTNode::listAccept(_contract.baseContracts(), *this);
|
ASTNode::listAccept(_contract.baseContracts(), *this);
|
||||||
|
|
||||||
@ -113,7 +115,9 @@ bool TypeChecker::visit(ContractDefinition const& _contract)
|
|||||||
_contract.annotation().isFullyImplemented = false;
|
_contract.annotation().isFullyImplemented = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASTNode::listAccept(_contract.subNodes(), *this);
|
for (auto const& n: _contract.subNodes())
|
||||||
|
if (!visited.count(n.get()))
|
||||||
|
n->accept(*this);
|
||||||
|
|
||||||
checkContractExternalTypeClashes(_contract);
|
checkContractExternalTypeClashes(_contract);
|
||||||
// check for hash collisions in function signatures
|
// check for hash collisions in function signatures
|
||||||
|
Loading…
Reference in New Issue
Block a user