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
@ -1882,9 +1882,30 @@ bool CommandLineInterface::assemble(
|
|||||||
sout() << stack.print() << endl;
|
sout() << stack.print() << endl;
|
||||||
|
|
||||||
if (_language != yul::AssemblyStack::Language::Ewasm && _targetMachine == yul::AssemblyStack::Machine::Ewasm)
|
if (_language != yul::AssemblyStack::Language::Ewasm && _targetMachine == yul::AssemblyStack::Machine::Ewasm)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
stack.translate(yul::AssemblyStack::Language::Ewasm);
|
stack.translate(yul::AssemblyStack::Language::Ewasm);
|
||||||
stack.optimize();
|
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 << "==========================" << endl;
|
||||||
sout() << endl << "Translated source:" << endl;
|
sout() << endl << "Translated source:" << endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user