summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCameron Esfahani <dirty@apple.com>2015-10-01 01:24:59 +0000
committerCameron Esfahani <dirty@apple.com>2015-10-01 01:24:59 +0000
commit3c55f2cd96aa0c1a8848c043a9e9680b7de804a3 (patch)
tree424d9beea390ff5f812a6be53a2da8b8b1f614a6
parentc50ae365091cd82dc2e808986ca121848e92f1ed (diff)
downloadbcm5719-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.cpp7
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
OpenPOWER on IntegriCloud