[cfe-commits] r129587 - in /cfe/trunk: lib/Frontend/DependencyFile.cpp test/Frontend/dependency-generation-crash.c
Fariborz Jahanian
fjahanian at apple.com
Fri Apr 15 11:49:23 PDT 2011
Author: fjahanian
Date: Fri Apr 15 13:49:23 2011
New Revision: 129587
URL: http://llvm.org/viewvc/llvm-project?rev=129587&view=rev
Log:
Fixes a crash when generating dependency file stuff
and output file is not writable. // rdar://9286457.
Added:
cfe/trunk/test/Frontend/dependency-generation-crash.c
Modified:
cfe/trunk/lib/Frontend/DependencyFile.cpp
Modified: cfe/trunk/lib/Frontend/DependencyFile.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/DependencyFile.cpp?rev=129587&r1=129586&r2=129587&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/DependencyFile.cpp (original)
+++ cfe/trunk/lib/Frontend/DependencyFile.cpp Fri Apr 15 13:49:23 2011
@@ -171,7 +171,7 @@
*OS << '\n';
// Create phony targets if requested.
- if (PhonyTarget) {
+ if (PhonyTarget && !Files.empty()) {
// Skip the first entry, this is always the input file itself.
for (std::vector<std::string>::iterator I = Files.begin() + 1,
E = Files.end(); I != E; ++I) {
Added: cfe/trunk/test/Frontend/dependency-generation-crash.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/dependency-generation-crash.c?rev=129587&view=auto
==============================================================================
--- cfe/trunk/test/Frontend/dependency-generation-crash.c (added)
+++ cfe/trunk/test/Frontend/dependency-generation-crash.c Fri Apr 15 13:49:23 2011
@@ -0,0 +1,4 @@
+// RUN: touch %t
+// RUN: chmod 0 %t
+// %clang -E -dependency-file bla -MT %t -MP -o %t -x c /dev/null
+// rdar://9286457
More information about the cfe-commits
mailing list