Merge pull request #3101 from ethereum/compilerstack-header

Remove the reliance on empty contract name equals "last contract" in CompilerStack
This commit is contained in:
chriseth
2017-10-19 13:43:17 +02:00
committed by GitHub
8 changed files with 56 additions and 41 deletions
+3 -2
View File
@@ -938,9 +938,10 @@ 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;
if (m_compiler->runtimeAssemblyItems())
// FIXME: shouldn't this be done for every contract?
if (m_compiler->runtimeAssemblyItems(m_compiler->lastContractName()))
gasCosts = GasEstimator::breakToStatementLevel(
GasEstimator::structuralEstimation(*m_compiler->runtimeAssemblyItems(), asts),
GasEstimator::structuralEstimation(*m_compiler->runtimeAssemblyItems(m_compiler->lastContractName()), asts),
asts
);