| Hasnain Lakhani | 4afb7d9 | 2025-08-25 16:09:41 -0700 | [diff] [blame] | 1 | # Swift Fuzzing README |
| 2 | |
| 3 | The Swift Thrift implementation uses LLVM's libFuzzer for fuzzing. |
| 4 | |
| 5 | ## Fuzzer Structure |
| 6 | |
| 7 | We currently have several fuzz targets that test different aspects of the Thrift implementation: |
| 8 | |
| 9 | * FuzzParseBinary -- Tries to deserialize the code-generated FuzzTest struct from arbitrary input data using the binary protocol |
| 10 | * FuzzRoundtripBinary -- Tries to deserialize a FuzzTest struct and then tests roundtrip serialization/deserialization with the binary protocol |
| 11 | * FuzzParseCompact |
| 12 | * FuzzRoundtripCompact |
| 13 | * FuzzParseJSON |
| 14 | * FuzzRoundtripJSON |
| 15 | |
| 16 | The fuzzers need a dummy main() to ensure that compilation in non-fuzzer modes doesn't regress. |