diff options
Diffstat (limited to 'solc/CommandLineInterface.cpp')
-rw-r--r-- | solc/CommandLineInterface.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index 8b331c75..6a768a00 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -447,7 +447,7 @@ bool CommandLineInterface::readInputFilesAndConfigureRemappings() m_sourceCodes[g_stdinFileName] = dev::readStandardInput(); if (m_sourceCodes.size() == 0) { - cerr << "No input files given. If you wish to use the standard input please specify \"-\" explicity." << endl; + cerr << "No input files given. If you wish to use the standard input please specify \"-\" explicitly." << endl; return false; } @@ -986,10 +986,15 @@ void CommandLineInterface::handleAst(string const& _argStr) map<ASTNode const*, eth::GasMeter::GasConsumption> gasCosts; // FIXME: shouldn't this be done for every contract? if (m_compiler->runtimeAssemblyItems(m_compiler->lastContractName())) - gasCosts = GasEstimator::breakToStatementLevel( + { + //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), asts ); + gasCosts = ret; + } bool legacyFormat = !m_args.count(g_argAstCompactJson); if (m_args.count(g_argOutputDir)) |