Merge pull request #5874 from ethereum/fuzzer-optim

Run constant optimiser on fresh inputs in the fuzzer
This commit is contained in:
chriseth 2019-01-28 11:57:38 +01:00 committed by GitHub
commit e6d102f2c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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())
); );
} }
} }