Merge pull request #11216 from ethereum/fix-abiv2-fuzzer-bug

Fix use of const ref in Abiv2 and other proto fuzzers.
This commit is contained in:
Bhargava Shastry 2021-04-14 15:03:57 +02:00 committed by GitHub
commit 6941143613
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 7 deletions

View File

@ -58,8 +58,9 @@ DEFINE_PROTO_FUZZER(Contract const& _contract)
// We target the default EVM which is the latest
langutil::EVMVersion version;
EVMHost hostContext(version, evmone);
string contractName = ":C";
CompilerInput cInput(version, {{"test.sol", contractSource}}, contractName, OptimiserSettings::minimal(), {});
string contractName = "C";
StringMap source({{"test.sol", contractSource}});
CompilerInput cInput(version, source, contractName, OptimiserSettings::minimal(), {});
EvmoneUtility evmoneUtil(
hostContext,
cInput,

View File

@ -61,7 +61,7 @@ struct CompilerInput
langutil::EVMVersion evmVersion;
/// Source code to be compiled
StringMap const& sourceCode;
/// Contract name
/// Contract name without a colon prefix
std::string contractName;
/// Optimiser setting to be used during compilation
frontend::OptimiserSettings optimiserSettings;

View File

@ -48,9 +48,10 @@ DEFINE_PROTO_FUZZER(Contract const& _input)
// We target the default EVM which is the latest
langutil::EVMVersion version;
EVMHost hostContext(version, evmone);
string contractName = ":C";
string contractName = "C";
string methodName = "test()";
CompilerInput cInput(version, {{"test.sol", contract_source}}, contractName, OptimiserSettings::minimal(), {});
StringMap source({{"test.sol", contract_source}});
CompilerInput cInput(version, source, contractName, OptimiserSettings::minimal(), {});
EvmoneUtility evmoneUtil(
hostContext,
cInput,

View File

@ -66,10 +66,11 @@ DEFINE_PROTO_FUZZER(Program const& _input)
// We target the default EVM which is the latest
langutil::EVMVersion version;
EVMHost hostContext(version, evmone);
string contractName = ":C";
string contractName = "C";
string libraryName = converter.libraryTest() ? converter.libraryName() : "";
string methodName = "test()";
CompilerInput cInput(version, {{"test.sol", sol_source}}, contractName, OptimiserSettings::minimal(), {});
StringMap source({{"test.sol", sol_source}});
CompilerInput cInput(version, source, contractName, OptimiserSettings::minimal(), {});
EvmoneUtility evmoneUtil(
hostContext,
cInput,