[FIXUP] Minor refactor

This commit is contained in:
Kamil Śliwak 2021-02-11 16:47:59 +01:00
parent 467a8b318b
commit bdd35badb8

View File

@ -57,11 +57,14 @@ FunctionCallGraphBuilder::FunctionCallGraphBuilder(ContractDefinition const& _co
for (FunctionTypePointer functionType: _contract.interfaceFunctionList() | views::transform(getSecondElement))
{
if (auto const* funcDef = dynamic_cast<FunctionDefinition const*>(&functionType->declaration()))
processFunction(*funcDef);
auto const* function = dynamic_cast<FunctionDefinition const*>(&functionType->declaration());
auto const* variable = dynamic_cast<VariableDeclaration const*>(&functionType->declaration());
if (function)
processFunction(*function);
else
// If it's not a function, it must be a getter of a public variable; we ignore those
solAssert(dynamic_cast<VariableDeclaration const*>(&functionType->declaration()), "");
solAssert(variable, "");
}
// Add all InternalCreationDispatch calls to the InternalDispatch as well
@ -115,11 +118,7 @@ bool FunctionCallGraphBuilder::visit(Identifier const& _identifier)
// For events kind() == Event, so we have an extra check here
if (funType && funType->kind() == FunctionType::Kind::Internal)
{
processFunction(callable->resolveVirtual(*m_contract), _identifier.annotation().calledDirectly);
solAssert(m_currentNode.has_value(), "");
}
}
return true;