From 0ebb95d63bcdc6bff0deeec2423e8c96c7731aef Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 15 Jul 2021 16:06:38 +0200 Subject: [PATCH] Add protection against mixing "viaIR" and "non-viaIR". --- libsolidity/interface/CompilerStack.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 93ddd4122..ff6923a62 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -753,6 +753,7 @@ Json::Value CompilerStack::generatedSources(string const& _contractName, bool _r // sources were generated. if (c.compiler) { + solAssert(!m_viaIR, ""); string source = _runtime ? c.compiler->runtimeGeneratedYulUtilityCode() : @@ -1075,6 +1076,7 @@ size_t CompilerStack::functionEntryPoint( shared_ptr const& compiler = contract(_contractName).compiler; if (!compiler) return 0; + solAssert(!m_viaIR, ""); evmasm::AssemblyItem tag = compiler->functionEntryLabel(_function); if (tag.type() == evmasm::UndefinedItem) return 0; @@ -1275,6 +1277,7 @@ void CompilerStack::compileContract( map>& _otherCompilers ) { + solAssert(!m_viaIR, ""); solAssert(m_stackState >= AnalysisPerformed, ""); if (m_hasError) BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("Called compile with errors."));