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)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157529 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Windows/Path.inc

index d8dc5226cceea3031e0911b859e10010dfa72ef6..aab0dff066e830485dce5f2be5794d8aa76410fa 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)) {