diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-01-28 05:42:38 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-01-28 05:42:38 +0000 |
| commit | 64d8fc25d6d10df2c23131882da018c201f19c49 (patch) | |
| tree | ecdad79ed548340a545e11a48f9fcb6cdb0d15a1 /clang/Driver/DependencyFile.cpp | |
| parent | 21114f21c4ac8c06a0aaad05f2e47f068610febc (diff) | |
| download | bcm5719-llvm-64d8fc25d6d10df2c23131882da018c201f19c49.tar.gz bcm5719-llvm-64d8fc25d6d10df2c23131882da018c201f19c49.zip | |
fix a crash I introduced, thanks to Ted for the awesome reduced
testcase :)
llvm-svn: 63182
Diffstat (limited to 'clang/Driver/DependencyFile.cpp')
| -rw-r--r-- | clang/Driver/DependencyFile.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/Driver/DependencyFile.cpp b/clang/Driver/DependencyFile.cpp index 0d4ee91f01b..673ca0734a1 100644 --- a/clang/Driver/DependencyFile.cpp +++ b/clang/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; |

