diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 5961e58a9..dee9940e6 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -1256,6 +1256,9 @@ void CompilerStack::generateEwasm(ContractDefinition const& _contract) if (m_hasError) BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("Called generateEwasm with errors.")); + if (!_contract.canBeDeployed()) + return; + Contract& compiledContract = m_contracts.at(_contract.fullyQualifiedName()); solAssert(!compiledContract.yulIROptimized.empty(), ""); if (!compiledContract.ewasm.empty()) diff --git a/test/cmdlineTests/standard_ewasm_requested_abstract/output.json b/test/cmdlineTests/standard_ewasm_requested_abstract/output.json index 55ff78db9..2858515df 100644 --- a/test/cmdlineTests/standard_ewasm_requested_abstract/output.json +++ b/test/cmdlineTests/standard_ewasm_requested_abstract/output.json @@ -1,2 +1 @@ -{"errors":[{"component":"general","formattedMessage":"InternalCompilerError: -","message":"Internal compiler error (/project/solidity/libsolidity/interface/CompilerStack.cpp:1260):","severity":"error","type":"InternalCompilerError"}],"sources":{"A":{"id":0}}} +{"contracts":{"A":{"C":{"ewasm":{"wasm":"","wast":""}}}},"sources":{"A":{"id":0}}}