]> granicus.if.org Git - clang/commitdiff
Fix PR16547.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 5 Jul 2013 15:05:40 +0000 (15:05 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 5 Jul 2013 15:05:40 +0000 (15:05 +0000)
We should not be asking unique_file to prepend the system temporary directory
when creating the html report. Unfortunately I don't think we can test this
with the current infrastructure since unique_file ignores MakeAbsolute if the
directory is already absolute and the paths provided by lit are.

I will take a quick look at making this api a bit less error prone.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185707 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp

index 120a63e7a240aa75cfea5e93095cb9350bc95c65..e32b85b9b3fb40e4f395152e12c5c1df16885d83 100644 (file)
@@ -247,8 +247,9 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D,
   SmallString<128> Model, ResultPath;
   llvm::sys::path::append(Model, Directory, "report-%%%%%%.html");
 
-  if (llvm::error_code EC =
-          llvm::sys::fs::unique_file(Model.str(), FD, ResultPath)) {
+  if (llvm::error_code EC = llvm::sys::fs::unique_file(
+          Model.str(), FD, ResultPath, false,
+          llvm::sys::fs::all_read | llvm::sys::fs::all_write)) {
     llvm::errs() << "warning: could not create file in '" << Directory
                  << "': " << EC.message() << '\n';
     return;