mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[solc] Handle exceptions in AssemblyStack.translate() gracefully
This commit is contained in:
parent
9230ddf110
commit
3246d0f9a9
@ -1883,8 +1883,29 @@ bool CommandLineInterface::assemble(
|
||||
|
||||
if (_language != yul::AssemblyStack::Language::Ewasm && _targetMachine == yul::AssemblyStack::Machine::Ewasm)
|
||||
{
|
||||
stack.translate(yul::AssemblyStack::Language::Ewasm);
|
||||
stack.optimize();
|
||||
try
|
||||
{
|
||||
stack.translate(yul::AssemblyStack::Language::Ewasm);
|
||||
stack.optimize();
|
||||
}
|
||||
catch (Exception const& _exception)
|
||||
{
|
||||
serr() << "Exception in assembler: " << boost::diagnostic_information(_exception) << endl;
|
||||
return false;
|
||||
}
|
||||
catch (std::exception const& _e)
|
||||
{
|
||||
serr() <<
|
||||
"Unknown exception during compilation" <<
|
||||
(_e.what() ? ": " + string(_e.what()) : ".") <<
|
||||
endl;
|
||||
return false;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
serr() << "Unknown exception in assembler." << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
sout() << endl << "==========================" << endl;
|
||||
sout() << endl << "Translated source:" << endl;
|
||||
|
Loading…
Reference in New Issue
Block a user