Path::GetTemporaryDirectory(): Add an assertion if TempDirectory is alive, to check...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Sun, 27 May 2012 13:02:04 +0000 (13:02 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Sun, 27 May 2012 13:02:04 +0000 (13:02 +0000)
llvm-svn: 157529

llvm/lib/Support/Windows/Path.inc

index d8dc522..aab0dff 100644 (file)
@@ -188,8 +188,10 @@ static Path *TempDirectory;
 
 Path
 Path::GetTemporaryDirectory(std::string* ErrMsg) {
-  if (TempDirectory)
+  if (TempDirectory) {
+    assert(TempDirectory->exists() && "Who has removed TempDirectory?");
     return *TempDirectory;
+  }
 
   char pathname[MAX_PATH];
   if (!GetTempPath(MAX_PATH, pathname)) {