[llvm-commits] [llvm] r157529 - /llvm/trunk/lib/Support/Windows/Path.inc

NAKAMURA Takumi geek4civic at gmail.com
Sun May 27 06:02:04 PDT 2012


Author: chapuni
Date: Sun May 27 08:02:04 2012
New Revision: 157529

URL: http://llvm.org/viewvc/llvm-project?rev=157529&view=rev
Log:
Path::GetTemporaryDirectory(): Add an assertion if TempDirectory is alive, to check when someone would remove the tempdir.

Modified:
    llvm/trunk/lib/Support/Windows/Path.inc

Modified: llvm/trunk/lib/Support/Windows/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Path.inc?rev=157529&r1=157528&r2=157529&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/Path.inc (original)
+++ llvm/trunk/lib/Support/Windows/Path.inc Sun May 27 08:02:04 2012
@@ -188,8 +188,10 @@
 
 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)) {





More information about the llvm-commits mailing list