yul proto fuzzer: Remove assertion that no errors/warnings while parsing yul code

This commit is contained in:
Bhargava Shastry 2020-06-30 13:26:50 +02:00
parent a1c33249f1
commit b82590322c
2 changed files with 13 additions and 9 deletions

View File

@ -59,13 +59,13 @@ DEFINE_PROTO_FUZZER(Program const& _input)
);
// Parse protobuf mutated YUL code
if (!stack.parseAndAnalyze("source", yul_source))
return;
yulAssert(stack.errors().empty(), "Parsed successfully but had errors.");
if (!stack.parserResult()->code || !stack.parserResult()->analysisInfo)
return;
if (
!stack.parseAndAnalyze("source", yul_source) ||
!stack.parserResult()->code ||
!stack.parserResult()->analysisInfo ||
!Error::containsOnlyWarnings(stack.errors())
)
yulAssert(false, "Proto fuzzer generated malformed program");
// Optimize
stack.optimize();

View File

@ -77,8 +77,12 @@ DEFINE_PROTO_FUZZER(Program const& _input)
);
// Parse protobuf mutated YUL code
if (!stack.parseAndAnalyze("source", yul_source) || !stack.parserResult()->code ||
!stack.parserResult()->analysisInfo)
if (
!stack.parseAndAnalyze("source", yul_source) ||
!stack.parserResult()->code ||
!stack.parserResult()->analysisInfo ||
!Error::containsOnlyWarnings(stack.errors())
)
{
printErrors(std::cout, stack.errors());
yulAssert(false, "Proto fuzzer generated malformed program");