reorder cases to improve throughput
mutating the first byte of the input now always results in picking on of the two paths. Before, two of the four possible outcomes resulted in doit() not being invoked.
This commit is contained in:
parent
bff3b9e5d1
commit
d98bf8776b
@ -27,7 +27,7 @@ template <typename C> void doit(const uint8_t* data, size_t size) {
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
if (size < 1) return 0;
|
||||
const auto action = data[0] & 0b11;
|
||||
const auto action = data[0] & 0b1;
|
||||
data += 1;
|
||||
size -= 1;
|
||||
|
||||
@ -37,12 +37,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
doit<std::chrono::system_clock>(data, size);
|
||||
break;
|
||||
case 1:
|
||||
// won't compile
|
||||
// doit<std::chrono::steady_clock>(data,size);
|
||||
// may be the same as system_clock
|
||||
doit<std::chrono::high_resolution_clock>(data, size);
|
||||
break;
|
||||
case 2:
|
||||
// may be the same as system_clock
|
||||
doit<std::chrono::high_resolution_clock>(data, size);
|
||||
// won't compile
|
||||
// doit<std::chrono::steady_clock>(data,size);
|
||||
break;
|
||||
}
|
||||
} catch (...) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user