| 130 | |
| 131 | #if defined(PROVIDE_FUZZ_MAIN_FUNCTION) |
| 132 | int main(int argc, char** argv) |
| 133 | { |
| 134 | initialize(); |
| 135 | static const auto& test_one_input = *Assert(g_test_one_input); |
| 136 | #ifdef __AFL_INIT |
| 137 | // Enable AFL deferred forkserver mode. Requires compilation using |
| 138 | // afl-clang-fast++. See fuzzing.md for details. |
| 139 | __AFL_INIT(); |
| 140 | #endif |
| 141 | |
| 142 | #ifdef __AFL_LOOP |
| 143 | // Enable AFL persistent mode. Requires compilation using afl-clang-fast++. |
| 144 | // See fuzzing.md for details. |
| 145 | while (__AFL_LOOP(1000)) { |
| 146 | std::vector<uint8_t> buffer; |
| 147 | if (!read_stdin(buffer)) { |
| 148 | continue; |
| 149 | } |
| 150 | test_one_input(buffer); |
| 151 | } |
| 152 | #else |
| 153 | std::vector<uint8_t> buffer; |
| 154 | if (!read_stdin(buffer)) { |
| 155 | return 0; |
| 156 | } |
| 157 | test_one_input(buffer); |
| 158 | #endif |
| 159 | return 0; |
| 160 | } |
| 161 | #endif |
nothing calls this directly
no test coverage detected