aboutsummaryrefslogtreecommitdiffstats
path: root/solc
diff options
context:
space:
mode:
authormestorlx <github@martindiz.com.ar>2018-10-15 23:54:48 +0800
committermestorlx <github@martindiz.com.ar>2018-10-16 01:26:15 +0800
commit9f9d6fdcc48bfbc1c039c903d60aa38a166c1850 (patch)
tree42920b862f17f4732135d4ef48557e5bd533facd /solc
parent238494752192a2c834eb8913b244671afb48d693 (diff)
downloaddexon-solidity-9f9d6fdcc48bfbc1c039c903d60aa38a166c1850.tar.gz
dexon-solidity-9f9d6fdcc48bfbc1c039c903d60aa38a166c1850.tar.zst
dexon-solidity-9f9d6fdcc48bfbc1c039c903d60aa38a166c1850.zip
fix issue##5007
Diffstat (limited to 'solc')
-rw-r--r--solc/CommandLineInterface.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp
index 4052ed13..e0c6a2b6 100644
--- a/solc/CommandLineInterface.cpp
+++ b/solc/CommandLineInterface.cpp
@@ -994,16 +994,14 @@ void CommandLineInterface::handleAst(string const& _argStr)
for (auto const& sourceCode: m_sourceCodes)
asts.push_back(&m_compiler->ast(sourceCode.first));
map<ASTNode const*, eth::GasMeter::GasConsumption> gasCosts;
- // FIXME: shouldn't this be done for every contract?
- if (m_compiler->runtimeAssemblyItems(m_compiler->lastContractName()))
+ for (auto const& contract : m_compiler->contractNames())
{
- //NOTE: keep the local variable `ret` to prevent a Heisenbug that could happen on certain mac os platform.
- //See: https://github.com/ethereum/solidity/issues/3718 for details.
auto ret = GasEstimator::breakToStatementLevel(
- GasEstimator(m_evmVersion).structuralEstimation(*m_compiler->runtimeAssemblyItems(m_compiler->lastContractName()), asts),
+ GasEstimator(m_evmVersion).structuralEstimation(*m_compiler->runtimeAssemblyItems(contract), asts),
asts
);
- gasCosts = ret;
+ for (auto const& it: ret)
+ gasCosts[it.first] += it.second;
}
bool legacyFormat = !m_args.count(g_argAstCompactJson);