Merge pull request #6199 from ethereum/ossfuzzsolcreduceinputsize

Reduce input file size for solc and constant optimizer fuzzers.
This commit is contained in:
chriseth 2019-03-06 11:58:51 +01:00 committed by GitHub
commit 3059734ae6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 6 deletions

View File

@ -21,7 +21,10 @@ using namespace std;
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* _data, size_t _size)
{
string input(reinterpret_cast<char const*>(_data), _size);
FuzzerUtil::testConstantOptimizer(input, /*quiet=*/true);
if (_size <= 250)
{
string input(reinterpret_cast<char const*>(_data), _size);
FuzzerUtil::testConstantOptimizer(input, /*quiet=*/true);
}
return 0;
}

View File

@ -21,7 +21,10 @@ using namespace std;
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* _data, size_t _size)
{
string input(reinterpret_cast<char const*>(_data), _size);
FuzzerUtil::testCompiler(input, /*optimize=*/false, /*quiet=*/true);
if (_size <= 600)
{
string input(reinterpret_cast<char const*>(_data), _size);
FuzzerUtil::testCompiler(input, /*optimize=*/false, /*quiet=*/true);
}
return 0;
}

View File

@ -21,7 +21,10 @@ using namespace std;
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* _data, size_t _size)
{
string input(reinterpret_cast<char const*>(_data), _size);
FuzzerUtil::testCompiler(input, /*optimize=*/true, /*quiet=*/true);
if (_size <= 600)
{
string input(reinterpret_cast<char const *>(_data), _size);
FuzzerUtil::testCompiler(input, /*optimize=*/true, /*quiet=*/true);
}
return 0;
}