Merge pull request #9084 from ethereum/remove-dead-code-from-execution-framework

Remove dead code from SolidityExecutionFramework::compileContract()
This commit is contained in:
chriseth 2020-06-02 17:00:27 +02:00 committed by GitHub
commit 837e29fff8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,20 +66,15 @@ bytes SolidityExecutionFramework::compileContract(
if (m_compileViaYul)
{
yul::AssemblyStack asmStack(
m_evmVersion,
yul::AssemblyStack::Language::StrictAssembly,
// Ignore optimiser settings here because we need Yul optimisation to
// get code that does not exhaust the stack.
OptimiserSettings::full()
);
if (!asmStack.parseAndAnalyze("", m_compiler.yulIROptimized(contractName)))
{
langutil::SourceReferenceFormatter formatter(std::cerr);
m_evmVersion,
yul::AssemblyStack::Language::StrictAssembly,
// Ignore optimiser settings here because we need Yul optimisation to
// get code that does not exhaust the stack.
OptimiserSettings::full()
);
bool analysisSuccessful = asmStack.parseAndAnalyze("", m_compiler.yulIROptimized(contractName));
solAssert(analysisSuccessful, "Code that passed analysis in CompilerStack can't have errors");
for (auto const& error: m_compiler.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);
}