diff options
| author | Cameron Esfahani <dirty@apple.com> | 2015-10-01 01:24:59 +0000 |
|---|---|---|
| committer | Cameron Esfahani <dirty@apple.com> | 2015-10-01 01:24:59 +0000 |
| commit | 3c55f2cd96aa0c1a8848c043a9e9680b7de804a3 (patch) | |
| tree | 424d9beea390ff5f812a6be53a2da8b8b1f614a6 | |
| parent | c50ae365091cd82dc2e808986ca121848e92f1ed (diff) | |
| download | bcm5719-llvm-3c55f2cd96aa0c1a8848c043a9e9680b7de804a3.tar.gz bcm5719-llvm-3c55f2cd96aa0c1a8848c043a9e9680b7de804a3.zip | |
createUniqueFile() is documented to create the file in the temporary directory unless it's supplied an absolute path.
Make sure the output filepath supplied to createUniqueFile() in HTMLDiagnostics::ReportDiag() is absolute.
Summary: Make sure the output filepath supplied to createUniqueFile() in HTMLDiagnostics::ReportDiag() is absolute.
Reviewers: rsmith, akyrtzi
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D12774
llvm-svn: 248977
| -rw-r--r-- | clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp index cfcf7c6a990..697aff9a67a 100644 --- a/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp +++ b/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp @@ -281,7 +281,12 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D, if (!AnalyzerOpts.shouldWriteStableReportFilename()) { llvm::sys::path::append(Model, Directory, "report-%%%%%%.html"); - + if (std::error_code EC = + llvm::sys::fs::make_absolute(Model)) { + llvm::errs() << "warning: could not make '" << Model + << "' absolute: " << EC.message() << '\n'; + return; + } if (std::error_code EC = llvm::sys::fs::createUniqueFile(Model, FD, ResultPath)) { llvm::errs() << "warning: could not create file in '" << Directory |

