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)
);
// HACK: Force this to fake stack limit evader for now
string step = "fakeStackLimitEvader";
string step = "stackLimitEvader";
optimizerTest.setStep(step);
// optimizerTest.setStep(optimizerTest.randomOptimiserStep(_input.step()));
shared_ptr<solidity::yul::Block> astBlock = optimizerTest.run();
@ -190,6 +190,6 @@ DEFINE_PROTO_FUZZER(Program const& _input)
}
solAssert(
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
// 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;
switch (type)
@ -1285,7 +1288,8 @@ void ProtoConverter::visit(TerminatingStmt const& _x)
visit(_x.ret_rev());
break;
case TerminatingStmt::kSelfDes:
visit(_x.self_des());
if (!m_filterStatefulInstructions)
visit(_x.self_des());
break;
case TerminatingStmt::TERM_ONEOF_NOT_SET:
break;