Run constant optimiser on fresh inputs in the fuzzer

This commit is contained in:
Alex Beregszaszi 2019-01-28 10:40:33 +00:00
parent 9836f90e70
commit 06998bc8e1

View File

@ -95,12 +95,14 @@ void FuzzerUtil::testConstantOptimizer(string const& _input, bool _quiet)
for (bool isCreation: {false, true}) for (bool isCreation: {false, true})
for (unsigned runs: {1, 2, 3, 20, 40, 100, 200, 400, 1000}) for (unsigned runs: {1, 2, 3, 20, 40, 100, 200, 400, 1000})
{ {
// Make a copy here so that each time we start with the original state.
Assembly tmp = assembly;
ConstantOptimisationMethod::optimiseConstants( ConstantOptimisationMethod::optimiseConstants(
isCreation, isCreation,
runs, runs,
EVMVersion{}, EVMVersion{},
assembly, assembly,
const_cast<AssemblyItems &>(assembly.items()) const_cast<AssemblyItems &>(tmp.items())
); );
} }
} }