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

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

View File

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

View File

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