[llvm] r293516 - [libFuzzer] Implement TmpDir() for Windows.
Marcos Pividori via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 30 10:14:53 PST 2017
Author: mpividori
Date: Mon Jan 30 12:14:53 2017
New Revision: 293516
URL: http://llvm.org/viewvc/llvm-project?rev=293516&view=rev
Log:
[libFuzzer] Implement TmpDir() for Windows.
Differential Revision: https://reviews.llvm.org/D28977
Modified:
llvm/trunk/lib/Fuzzer/FuzzerIOWindows.cpp
Modified: llvm/trunk/lib/Fuzzer/FuzzerIOWindows.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerIOWindows.cpp?rev=293516&r1=293515&r2=293516&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerIOWindows.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerIOWindows.cpp Mon Jan 30 12:14:53 2017
@@ -287,7 +287,17 @@ std::string DirName(const std::string &F
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)
More information about the llvm-commits
mailing list