Merge pull request #7444 from ethereum/solc-fuzzer-add-evmversion

solc fuzzer: Use randomly chosen evm version
This commit is contained in:
chriseth 2019-09-17 15:23:17 +02:00 committed by GitHub
commit 7c774c3a4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,6 +28,15 @@ using namespace std;
using namespace dev;
using namespace dev::eth;
static vector<string> s_evmVersions = {
"homestead",
"tangerineWhistle",
"spuriousDragon",
"byzantium",
"constantinople",
"petersburg"
};
void FuzzerUtil::runCompiler(string const& _input, bool _quiet)
{
if (!_quiet)
@ -76,6 +85,7 @@ void FuzzerUtil::testCompiler(string const& _input, bool _optimize, bool _quiet)
config["settings"]["optimizer"] = Json::objectValue;
config["settings"]["optimizer"]["enabled"] = _optimize;
config["settings"]["optimizer"]["runs"] = 200;
config["settings"]["evmVersion"] = s_evmVersions[_input.size() % s_evmVersions.size()];
// Enable all SourceUnit-level outputs.
config["settings"]["outputSelection"]["*"][""][0] = "*";