]> granicus.if.org Git - clang/commitdiff
[analyzer] Close file handle before output to file from external command.
authorAnton Yartsev <anton.yartsev@gmail.com>
Wed, 17 Jun 2015 23:12:33 +0000 (23:12 +0000)
committerAnton Yartsev <anton.yartsev@gmail.com>
Wed, 17 Jun 2015 23:12:33 +0000 (23:12 +0000)
An old code caused problems under Windows - additional temporary file was created for clang preprocessor output while the right output file remained empty.

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

tools/scan-build/ccc-analyzer

index 4549b29a806e8e0be844723c5f4e9c0020bf71c9..cf56d14ebe8fe0b8c41c18e08c3b65e79ee738c8 100755 (executable)
@@ -135,8 +135,8 @@ sub ProcessClangFailure {
   my ($PPH, $PPFile) = tempfile( $prefix . "_XXXXXX",
                                  SUFFIX => GetPPExt($Lang),
                                  DIR => $Dir);
-  system $Clang, @$Args, "-E", "-o", $PPFile;
   close ($PPH);
+  system $Clang, @$Args, "-E", "-o", $PPFile;
 
   # Create the info file.
   open (OUT, ">", "$PPFile.info.txt") or die "Cannot open $PPFile.info.txt\n";