Skip to content

Commit dafe006

Browse files
clonkercameel
authored andcommitted
ossfuzz uses yul AST instead of separate block and dialect
1 parent 8859625 commit dafe006

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

test/tools/ossfuzz/strictasm_diff_ossfuzz.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t const* _data, size_t _size)
9090
// TODO: Add EOF support
9191
yulFuzzerUtil::TerminationReason termReason = yulFuzzerUtil::interpret(
9292
os1,
93-
stack.parserResult()->code()->root(),
94-
EVMDialect::strictAssemblyForEVMObjects(langutil::EVMVersion(), std::nullopt),
93+
*stack.parserResult()->code(),
9594
/*disableMemoryTracing=*/true
9695
);
9796
if (yulFuzzerUtil::resourceLimitsExceeded(termReason))
@@ -100,8 +99,7 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t const* _data, size_t _size)
10099
stack.optimize();
101100
termReason = yulFuzzerUtil::interpret(
102101
os2,
103-
stack.parserResult()->code()->root(),
104-
EVMDialect::strictAssemblyForEVMObjects(langutil::EVMVersion(), std::nullopt),
102+
*stack.parserResult()->code(),
105103
/*disableMemoryTracing=*/true
106104
);
107105

test/tools/ossfuzz/yulFuzzerCommon.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ using namespace solidity::yul::test::yul_fuzzer;
2323

2424
yulFuzzerUtil::TerminationReason yulFuzzerUtil::interpret(
2525
std::ostream& _os,
26-
yul::Block const& _astRoot,
27-
Dialect const& _dialect,
26+
AST const& _ast,
2827
bool _disableMemoryTracing,
2928
bool _outputStorageOnly,
3029
size_t _maxSteps,
@@ -52,7 +51,7 @@ yulFuzzerUtil::TerminationReason yulFuzzerUtil::interpret(
5251
TerminationReason reason = TerminationReason::None;
5352
try
5453
{
55-
Interpreter::run(state, _dialect, _astRoot, true, _disableMemoryTracing);
54+
Interpreter::run(state, _ast, true, _disableMemoryTracing);
5655
}
5756
catch (StepLimitReached const&)
5857
{

test/tools/ossfuzz/yulFuzzerCommon.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ struct yulFuzzerUtil
4040
/// eliminator.
4141
static TerminationReason interpret(
4242
std::ostream& _os,
43-
yul::Block const& _astRoot,
44-
Dialect const& _dialect,
43+
AST const& _ast,
4544
bool _disableMemoryTracing = false,
4645
bool _outputStorageOnly = false,
4746
size_t _maxSteps = maxSteps,

test/tools/ossfuzz/yulProto_diff_ossfuzz.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ DEFINE_PROTO_FUZZER(Program const& _input)
9090
// TODO: Add EOF support
9191
yulFuzzerUtil::TerminationReason termReason = yulFuzzerUtil::interpret(
9292
os1,
93-
stack.parserResult()->code()->root(),
94-
EVMDialect::strictAssemblyForEVMObjects(version, std::nullopt),
93+
*stack.parserResult()->code(),
9594
/*disableMemoryTracing=*/true
9695
);
9796

@@ -106,8 +105,7 @@ DEFINE_PROTO_FUZZER(Program const& _input)
106105
// TODO: Add EOF support
107106
termReason = yulFuzzerUtil::interpret(
108107
os2,
109-
*astRoot,
110-
EVMDialect::strictAssemblyForEVMObjects(version, std::nullopt),
108+
*optimizerTest.optimizedObject()->code(),
111109
true
112110
);
113111
if (yulFuzzerUtil::resourceLimitsExceeded(termReason))

0 commit comments

Comments
 (0)