| 440 | } |
| 441 | |
| 442 | bool ParseTransformations( |
| 443 | const std::string& transformations_file, |
| 444 | spvtools::fuzz::protobufs::TransformationSequence* transformations) { |
| 445 | std::ifstream transformations_stream; |
| 446 | transformations_stream.open(transformations_file, |
| 447 | std::ios::in | std::ios::binary); |
| 448 | auto parse_success = |
| 449 | transformations->ParseFromIstream(&transformations_stream); |
| 450 | transformations_stream.close(); |
| 451 | if (!parse_success) { |
| 452 | spvtools::Error(FuzzDiagnostic, nullptr, {}, |
| 453 | ("Error reading transformations from file '" + |
| 454 | transformations_file + "'") |
| 455 | .c_str()); |
| 456 | return false; |
| 457 | } |
| 458 | return true; |
| 459 | } |
| 460 | |
| 461 | bool Replay(const spv_target_env& target_env, |
| 462 | spv_const_fuzzer_options fuzzer_options, |