fix a crash I introduced, thanks to Ted for the awesome reduced
testcase :)
llvm-svn: 63182
diff --git a/clang/Driver/DependencyFile.cpp b/clang/Driver/DependencyFile.cpp
index 0d4ee91..673ca07 100644
--- a/clang/Driver/DependencyFile.cpp
+++ b/clang/Driver/DependencyFile.cpp
@@ -174,8 +174,11 @@
// #line markers to affect dependency generation!
SourceManager &SM = PP->getSourceManager();
- FileID FID = SM.getFileID(SM.getInstantiationLoc(Loc));
- const char *Filename = SM.getFileEntryForID(FID)->getName();
+ const FileEntry *FE =
+ SM.getFileEntryForID(SM.getFileID(SM.getInstantiationLoc(Loc)));
+ if (FE == 0) return;
+
+ const char *Filename = FE->getName();
if (!FileMatchesDepCriteria(Filename, FileType))
return;