From b030e8a5c804552597a917caf8948b9952a3663d Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sun, 27 May 2012 13:02:04 +0000 Subject: Path::GetTemporaryDirectory(): Add an assertion if TempDirectory is alive, to check when someone would remove the tempdir. llvm-svn: 157529 --- llvm/lib/Support/Windows/Path.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Support/Windows') diff --git a/llvm/lib/Support/Windows/Path.inc b/llvm/lib/Support/Windows/Path.inc index d8dc5226cce..aab0dff066e 100644 --- a/llvm/lib/Support/Windows/Path.inc +++ b/llvm/lib/Support/Windows/Path.inc @@ -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)) { -- cgit v1.2.3