Ensure we fail gracefully when user tries to optimize Yul code

This commit is contained in:
Bhargava Shastry
2019-02-12 11:21:02 +01:00
parent 0b392fff7e
commit 7751fa740f
4 changed files with 6 additions and 7 deletions
+2 -1
View File
@@ -84,7 +84,8 @@ bool AssemblyStack::parseAndAnalyze(std::string const& _sourceName, std::string
void AssemblyStack::optimize()
{
solAssert(m_language != Language::Assembly, "Optimization requested for loose assembly.");
if (m_language != Language::StrictAssembly)
solUnimplemented("Optimizer for both loose assembly and Yul is not yet implemented");
solAssert(m_analysisSuccessful, "Analysis was not successful.");
m_analysisSuccessful = false;
optimize(*m_parserResult);