aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-04-10 21:59:30 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-04-13 09:17:40 +0800
commit3fbb48bd46b613f83c6918e3b43068c72a214965 (patch)
treea315e6d82f3cf5dc3eb825107585eeb04932a5cc
parent328f2b0a8efa41d0343b4df022ce1106a5984fb4 (diff)
downloaddexon-solidity-3fbb48bd46b613f83c6918e3b43068c72a214965.tar.gz
dexon-solidity-3fbb48bd46b613f83c6918e3b43068c72a214965.tar.zst
dexon-solidity-3fbb48bd46b613f83c6918e3b43068c72a214965.zip
Exclude fallback function from the internal functions in estimateGas
-rw-r--r--libsolidity/interface/CompilerStack.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp
index 0fddd505..ea648709 100644
--- a/libsolidity/interface/CompilerStack.cpp
+++ b/libsolidity/interface/CompilerStack.cpp
@@ -903,7 +903,8 @@ Json::Value CompilerStack::gasEstimates(string const& _contractName) const
Json::Value internalFunctions(Json::objectValue);
for (auto const& it: contract.definedFunctions())
{
- if (it->isPartOfExternalInterface() || it->isConstructor())
+ /// Exclude externally visible functions, constructor and the fallback function
+ if (it->isPartOfExternalInterface() || it->isConstructor() || it->name().empty())
continue;
size_t entry = functionEntryPoint(_contractName, *it);