mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Rename function.
This commit is contained in:
parent
65b8329b24
commit
db9372463e
@ -58,7 +58,7 @@ using namespace std;
|
|||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
/// @returns true if there are no recursive functions, false otherwise.
|
/// @returns true if there are no recursive functions, false otherwise.
|
||||||
bool recursiveFunctionExists(Dialect const& _dialect, yul::Object& _object)
|
bool recursiveFunctionHasUnreachableVariables(Dialect const& _dialect, yul::Object& _object)
|
||||||
{
|
{
|
||||||
auto recursiveFunctions = CallGraphGenerator::callGraph(*_object.code).recursiveFunctions();
|
auto recursiveFunctions = CallGraphGenerator::callGraph(*_object.code).recursiveFunctions();
|
||||||
for(auto&& [function, variables]: CompilabilityChecker{
|
for(auto&& [function, variables]: CompilabilityChecker{
|
||||||
@ -150,7 +150,7 @@ DEFINE_PROTO_FUZZER(Program const& _input)
|
|||||||
string step = "stackLimitEvader";
|
string step = "stackLimitEvader";
|
||||||
optimizerTest.setStep(step);
|
optimizerTest.setStep(step);
|
||||||
shared_ptr<solidity::yul::Block> astBlock = optimizerTest.run();
|
shared_ptr<solidity::yul::Block> astBlock = optimizerTest.run();
|
||||||
bool recursiveFunction = recursiveFunctionExists(dialect, *subObject);
|
bool recursiveFunction = recursiveFunctionHasUnreachableVariables(dialect, *subObject);
|
||||||
string optimisedSubObject = AsmPrinter{}(*astBlock);
|
string optimisedSubObject = AsmPrinter{}(*astBlock);
|
||||||
string optimisedProgram = Whiskers(R"(
|
string optimisedProgram = Whiskers(R"(
|
||||||
object "main" {
|
object "main" {
|
||||||
@ -200,6 +200,9 @@ DEFINE_PROTO_FUZZER(Program const& _input)
|
|||||||
);
|
);
|
||||||
auto callMessageOpt = YulEvmoneUtility{}.callMessage(deployResultOpt.create_address);
|
auto callMessageOpt = YulEvmoneUtility{}.callMessage(deployResultOpt.create_address);
|
||||||
evmc::result callResultOpt = hostContext.call(callMessageOpt);
|
evmc::result callResultOpt = hostContext.call(callMessageOpt);
|
||||||
|
// Bail out if we ran out of gas.
|
||||||
|
if (callResultOpt.status_code == EVMC_OUT_OF_GAS)
|
||||||
|
return 0;
|
||||||
bool noRevertInSource = yulSubObject.find("revert") == string::npos;
|
bool noRevertInSource = yulSubObject.find("revert") == string::npos;
|
||||||
bool noInvalidInSource = yulSubObject.find("invalid") == string::npos;
|
bool noInvalidInSource = yulSubObject.find("invalid") == string::npos;
|
||||||
if (noRevertInSource)
|
if (noRevertInSource)
|
||||||
@ -218,8 +221,6 @@ DEFINE_PROTO_FUZZER(Program const& _input)
|
|||||||
(!noInvalidInSource && callResultOpt.status_code == EVMC_INVALID_INSTRUCTION)),
|
(!noInvalidInSource && callResultOpt.status_code == EVMC_INVALID_INSTRUCTION)),
|
||||||
"Optimised call failed."
|
"Optimised call failed."
|
||||||
);
|
);
|
||||||
if (callResultOpt.status_code == EVMC_OUT_OF_GAS)
|
|
||||||
return;
|
|
||||||
ostringstream optimizedState;
|
ostringstream optimizedState;
|
||||||
optimizedState << EVMHostPrinter{hostContext, deployResultOpt.create_address}.storageOnly();
|
optimizedState << EVMHostPrinter{hostContext, deployResultOpt.create_address}.storageOnly();
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@ static LPMPostProcessor<Block> addStoreToZero(
|
|||||||
);
|
);
|
||||||
|
|
||||||
static LPMPostProcessor<FunctionDef> addStackPressure(
|
static LPMPostProcessor<FunctionDef> addStackPressure(
|
||||||
[](FunctionDef* _message, unsigned _seed)
|
[](FunctionDef* _message, unsigned)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
MutationInfo m{_message, "Added stack pressure"};
|
MutationInfo m{_message, "Added stack pressure"};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user