Skip to content

Commit

Permalink
Add protection against mixing "viaIR" and "non-viaIR".
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseth committed Sep 22, 2021
1 parent bcdaa0c commit 9f8406a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libsolidity/interface/CompilerStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -741,9 +741,10 @@ Json::Value CompilerStack::generatedSources(string const& _contractName, bool _r
return sources.init([&]{
Json::Value sources{Json::arrayValue};
// If there is no compiler, then no bytecode was generated and thus no
// sources were generated.
// sources were generated (or we compiled "via IR").
if (c.compiler)
{
solAssert(!m_viaIR, "");
string source =
_runtime ?
c.compiler->runtimeGeneratedYulUtilityCode() :
Expand Down Expand Up @@ -1251,6 +1252,7 @@ void CompilerStack::compileContract(
map<ContractDefinition const*, shared_ptr<Compiler const>>& _otherCompilers
)
{
solAssert(!m_viaIR, "");
solAssert(m_stackState >= AnalysisPerformed, "");
if (m_hasError)
BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("Called compile with errors."));
Expand Down

0 comments on commit 9f8406a

Please sign in to comment.