Skip to content

Commit

Permalink
[libFuzzer] Implement TmpDir() for Windows.
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D28977

llvm-svn: 293516
  • Loading branch information
Marcos Pividori committed Jan 30, 2017
1 parent a53a722 commit d2406ea
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion llvm/lib/Fuzzer/FuzzerIOWindows.cpp
Expand Up @@ -287,7 +287,17 @@ std::string DirName(const std::string &FileName) {
return FileName.substr(0, LocationLen + DirLen);
}

std::string TmpDir() { return "TODO: implement TmpDir"; }
std::string TmpDir() {
std::string Tmp;
Tmp.resize(MAX_PATH + 1);
DWORD Size = GetTempPathA(Tmp.size(), &Tmp[0]);
if (Size == 0) {
Printf("Couldn't get Tmp path.\n");
exit(1);
}
Tmp.resize(Size);
return Tmp;
}

bool IsInterestingCoverageFile(const std::string &FileName) {
if (FileName.find("Program Files") != std::string::npos)
Expand Down

0 comments on commit d2406ea

Please sign in to comment.