From 11bda6f0e7e76db1d209322aa1abbdac236706fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Fri, 5 Feb 2021 13:37:35 +0100 Subject: [PATCH] [FIXUP] Don't add public getters to the graph --- libsolidity/analysis/FunctionCallGraph.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libsolidity/analysis/FunctionCallGraph.cpp b/libsolidity/analysis/FunctionCallGraph.cpp index d7fc46999..1a6752e95 100644 --- a/libsolidity/analysis/FunctionCallGraph.cpp +++ b/libsolidity/analysis/FunctionCallGraph.cpp @@ -58,11 +58,16 @@ FunctionCallGraphBuilder::FunctionCallGraphBuilder(ContractDefinition const& _co for (FunctionTypePointer functionType: _contract.interfaceFunctionList() | views::transform(getSecondElement)) { if (auto const* funcDef = dynamic_cast(&functionType->declaration())) + { if (!m_graph->edges.count(funcDef)) visitCallable(funcDef); - // Add all external functions to the RuntimeDispatch - add(SpecialNode::Entry, &functionType->declaration()); + // Add all external functions to the RuntimeDispatch + add(SpecialNode::Entry, &functionType->declaration()); + } + else + // If it's not a function, it must be a getter of a public variable; we ignore those + solAssert(dynamic_cast(&functionType->declaration()), ""); } // Add all InternalCreationDispatch calls to the InternalDispatch as well