Disable calldata and return data copy, self destruct.

This commit is contained in:
Bhargava Shastry 2021-04-13 12:46:27 +02:00
parent 058e871ce2
commit d2f864916c
2 changed files with 8 additions and 4 deletions

View File

@ -131,7 +131,7 @@ DEFINE_PROTO_FUZZER(Program const& _input)
EVMDialect::strictAssemblyForEVMObjects(version) EVMDialect::strictAssemblyForEVMObjects(version)
); );
// HACK: Force this to fake stack limit evader for now // HACK: Force this to fake stack limit evader for now
string step = "fakeStackLimitEvader"; string step = "stackLimitEvader";
optimizerTest.setStep(step); optimizerTest.setStep(step);
// optimizerTest.setStep(optimizerTest.randomOptimiserStep(_input.step())); // optimizerTest.setStep(optimizerTest.randomOptimiserStep(_input.step()));
shared_ptr<solidity::yul::Block> astBlock = optimizerTest.run(); shared_ptr<solidity::yul::Block> astBlock = optimizerTest.run();
@ -190,6 +190,6 @@ DEFINE_PROTO_FUZZER(Program const& _input)
} }
solAssert( solAssert(
unoptimizedState.str() == optimizedState.str(), unoptimizedState.str() == optimizedState.str(),
"State of unoptimised and optimised stack reused code do not match." "State of unoptimised and optimised stack saver code do not match."
); );
} }

View File

@ -757,7 +757,10 @@ void ProtoConverter::visit(CopyFunc const& _x)
// Code copy may change state if e.g., some byte of code // Code copy may change state if e.g., some byte of code
// is stored to storage via a sequence of mload and sstore. // is stored to storage via a sequence of mload and sstore.
if (m_filterStatefulInstructions && type == CopyFunc::CODE) if (
m_filterStatefulInstructions &&
(type == CopyFunc::CODE || type == CopyFunc::CALLDATA || type == CopyFunc::RETURNDATA)
)
return; return;
switch (type) switch (type)
@ -1285,6 +1288,7 @@ void ProtoConverter::visit(TerminatingStmt const& _x)
visit(_x.ret_rev()); visit(_x.ret_rev());
break; break;
case TerminatingStmt::kSelfDes: case TerminatingStmt::kSelfDes:
if (!m_filterStatefulInstructions)
visit(_x.self_des()); visit(_x.self_des());
break; break;
case TerminatingStmt::TERM_ONEOF_NOT_SET: case TerminatingStmt::TERM_ONEOF_NOT_SET: