| 489 | } |
| 490 | |
| 491 | static void WriteEdgeToMutationGraphFile(const std::string &MutationGraphFile, |
| 492 | const InputInfo *II, |
| 493 | const InputInfo *BaseII, |
| 494 | const std::string &MS) { |
| 495 | if (MutationGraphFile.empty()) |
| 496 | return; |
| 497 | |
| 498 | std::string Sha1 = Sha1ToString(II->Sha1); |
| 499 | |
| 500 | std::string OutputString; |
| 501 | |
| 502 | // Add a new vertex. |
| 503 | OutputString.append("\""); |
| 504 | OutputString.append(Sha1); |
| 505 | OutputString.append("\"\n"); |
| 506 | |
| 507 | // Add a new edge if there is base input. |
| 508 | if (BaseII) { |
| 509 | std::string BaseSha1 = Sha1ToString(BaseII->Sha1); |
| 510 | OutputString.append("\""); |
| 511 | OutputString.append(BaseSha1); |
| 512 | OutputString.append("\" -> \""); |
| 513 | OutputString.append(Sha1); |
| 514 | OutputString.append("\" [label=\""); |
| 515 | OutputString.append(MS); |
| 516 | OutputString.append("\"];\n"); |
| 517 | } |
| 518 | |
| 519 | AppendToFile(OutputString, MutationGraphFile); |
| 520 | } |
| 521 | |
| 522 | bool Fuzzer::RunOne(const uint8_t *Data, size_t Size, bool MayDeleteFile, |
| 523 | InputInfo *II, bool ForceAddToCorpus, |
no test coverage detected