SolidityExecutionFramework: Remove dead code for handling errors from parsing and analysis

- This code can never be reached because CompilerStack.compile() called above does the same analysis and fails if it's not successful.
This commit is contained in:
Kamil Śliwak 2020-06-01 18:24:31 +02:00
parent 311f025eb5
commit df7b82bf31

View File

@ -72,14 +72,9 @@ bytes SolidityExecutionFramework::compileContract(
// get code that does not exhaust the stack.
OptimiserSettings::full()
);
if (!asmStack.parseAndAnalyze("", m_compiler.yulIROptimized(contractName)))
{
langutil::SourceReferenceFormatter formatter(std::cerr);
bool analysisSuccessful = asmStack.parseAndAnalyze("", m_compiler.yulIROptimized(contractName));
solAssert(analysisSuccessful, "Code that passed analysis in CompilerStack can't have errors");
for (auto const& error: asmStack.errors())
formatter.printErrorInformation(*error);
BOOST_ERROR("Assembly contract failed. IR: " + m_compiler.yulIROptimized({}));
}
asmStack.optimize();
obj = std::move(*asmStack.assemble(yul::AssemblyStack::Machine::EVM).bytecode);
}