mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
yulInterpreter: More fine-grained exception handling
This commit is contained in:
@@ -72,9 +72,26 @@ DEFINE_PROTO_FUZZER(Function const& _input)
|
||||
|
||||
ostringstream os1;
|
||||
ostringstream os2;
|
||||
yulFuzzerUtil::interpret(os1, stack.parserResult()->code);
|
||||
try
|
||||
{
|
||||
yulFuzzerUtil::interpret(os1, stack.parserResult()->code);
|
||||
}
|
||||
catch (yul::test::StepLimitReached const&)
|
||||
{
|
||||
return;
|
||||
}
|
||||
catch (yul::test::InterpreterTerminatedGeneric const&)
|
||||
{
|
||||
}
|
||||
|
||||
stack.optimize();
|
||||
yulFuzzerUtil::interpret(os2, stack.parserResult()->code);
|
||||
try
|
||||
{
|
||||
yulFuzzerUtil::interpret(os2, stack.parserResult()->code);
|
||||
}
|
||||
catch (yul::test::InterpreterTerminatedGeneric const&)
|
||||
{
|
||||
}
|
||||
|
||||
bool isTraceEq = (os1.str() == os2.str());
|
||||
yulAssert(isTraceEq, "Interpreted traces for optimized and unoptimized code differ.");
|
||||
|
||||
Reference in New Issue
Block a user