mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #11864 from ethereum/protectViaIR
Add protection against mixing "viaIR" and "non-viaIR".
This commit is contained in:
commit
5a3a5c746f
@ -741,9 +741,10 @@ Json::Value CompilerStack::generatedSources(string const& _contractName, bool _r
|
|||||||
return sources.init([&]{
|
return sources.init([&]{
|
||||||
Json::Value sources{Json::arrayValue};
|
Json::Value sources{Json::arrayValue};
|
||||||
// If there is no compiler, then no bytecode was generated and thus no
|
// 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)
|
if (c.compiler)
|
||||||
{
|
{
|
||||||
|
solAssert(!m_viaIR, "");
|
||||||
string source =
|
string source =
|
||||||
_runtime ?
|
_runtime ?
|
||||||
c.compiler->runtimeGeneratedYulUtilityCode() :
|
c.compiler->runtimeGeneratedYulUtilityCode() :
|
||||||
@ -1251,6 +1252,7 @@ void CompilerStack::compileContract(
|
|||||||
map<ContractDefinition const*, shared_ptr<Compiler const>>& _otherCompilers
|
map<ContractDefinition const*, shared_ptr<Compiler const>>& _otherCompilers
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
solAssert(!m_viaIR, "");
|
||||||
solAssert(m_stackState >= AnalysisPerformed, "");
|
solAssert(m_stackState >= AnalysisPerformed, "");
|
||||||
if (m_hasError)
|
if (m_hasError)
|
||||||
BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("Called compile with errors."));
|
BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("Called compile with errors."));
|
||||||
|
Loading…
Reference in New Issue
Block a user