mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Filter log statements and remove gas comparison.
This commit is contained in:
parent
6f59e228eb
commit
cfda0e41ce
@ -71,11 +71,6 @@ DEFINE_PROTO_FUZZER(Program const& _input)
|
||||
of.write(yul_source.data(), static_cast<streamsize>(yul_source.size()));
|
||||
}
|
||||
|
||||
// Do not proceed with tests that are too large. 1200 is an arbitrary
|
||||
// threshold.
|
||||
if (yul_source.size() > 1200)
|
||||
return;
|
||||
|
||||
YulStringRepository::reset();
|
||||
|
||||
solidity::frontend::OptimiserSettings settings = solidity::frontend::OptimiserSettings::full();
|
||||
@ -162,18 +157,6 @@ DEFINE_PROTO_FUZZER(Program const& _input)
|
||||
ostringstream optimizedState;
|
||||
optimizedState << EVMHostPrinter{hostContext, deployResultOpt.create_address}.state();
|
||||
|
||||
int64_t constexpr tolerance = 1000;
|
||||
if (callResult.gas_left > callResultOpt.gas_left)
|
||||
if (callResult.gas_left - callResultOpt.gas_left > tolerance)
|
||||
{
|
||||
cout << "Gas differential " << callResult.gas_left - callResultOpt.gas_left << endl;
|
||||
cout << "Unoptimised bytecode" << endl;
|
||||
cout << util::toHex(unoptimisedByteCode) << endl;
|
||||
cout << "Optimised bytecode" << endl;
|
||||
cout << util::toHex(optimisedByteCode) << endl;
|
||||
solAssert(false, "Optimised code consumed more than +1000 gas.");
|
||||
}
|
||||
|
||||
solAssert(
|
||||
unoptimizedState.str() == optimizedState.str(),
|
||||
"State of unoptimised and optimised stack reused code do not match."
|
||||
|
@ -1348,7 +1348,9 @@ void ProtoConverter::visit(Statement const& _x)
|
||||
m_output << "continue\n";
|
||||
break;
|
||||
case Statement::kLogFunc:
|
||||
visit(_x.log_func());
|
||||
// Log is a stateful statement since it writes to storage.
|
||||
if (!m_filterStatefulInstructions)
|
||||
visit(_x.log_func());
|
||||
break;
|
||||
case Statement::kCopyFunc:
|
||||
visit(_x.copy_func());
|
||||
|
Loading…
Reference in New Issue
Block a user