aboutsummaryrefslogtreecommitdiff
path: root/Driver/DependencyFile.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-28 05:42:38 +0000
committerChris Lattner <sabre@nondot.org>2009-01-28 05:42:38 +0000
commite86e4cd097f50ca1c0bfde9142e0460d0d1203db (patch)
treecc56744e5efe7d67d3f73818dc54b5308d831649 /Driver/DependencyFile.cpp
parent611a15a18f34de57870f66b57b6d287fd29a9ad1 (diff)
fix a crash I introduced, thanks to Ted for the awesome reduced
testcase :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63182 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/DependencyFile.cpp')
-rw-r--r--Driver/DependencyFile.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Driver/DependencyFile.cpp b/Driver/DependencyFile.cpp
index 0d4ee91f01..673ca0734a 100644
--- a/Driver/DependencyFile.cpp
+++ b/Driver/DependencyFile.cpp
@@ -174,8 +174,11 @@ void DependencyFileCallback::FileChanged(SourceLocation Loc,
// #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;