diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-16 20:01:30 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-16 20:01:30 +0000 |
commit | 4fb7fbef3b3ff9233d8163a40eefafd8b36e9fd1 (patch) | |
tree | becb455ac4bd68fee869e1cf68500ecbffdba37f /clang/lib/Lex/PPLexerChange.cpp | |
parent | 26266da3c35d5a47770a9b165d5b5c74e714898b (diff) | |
download | bcm5719-llvm-4fb7fbef3b3ff9233d8163a40eefafd8b36e9fd1.tar.gz bcm5719-llvm-4fb7fbef3b3ff9233d8163a40eefafd8b36e9fd1.zip |
Audit all getBuffer() callers (for both the FullSourceLoc and
SourceManager versions), updating those callers that need to recover
gracefully from failure.
llvm-svn: 98665
Diffstat (limited to 'clang/lib/Lex/PPLexerChange.cpp')
-rw-r--r-- | clang/lib/Lex/PPLexerChange.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Lex/PPLexerChange.cpp b/clang/lib/Lex/PPLexerChange.cpp index 81e6bf80902..6d1c132fc0a 100644 --- a/clang/lib/Lex/PPLexerChange.cpp +++ b/clang/lib/Lex/PPLexerChange.cpp @@ -80,8 +80,10 @@ bool Preprocessor::EnterSourceFile(FileID FID, const DirectoryLookup *CurDir, } // Get the MemoryBuffer for this FID, if it fails, we fail. - const llvm::MemoryBuffer *InputFile = getSourceManager().getBuffer(FID); - if (!InputFile) + bool Invalid = false; + const llvm::MemoryBuffer *InputFile = getSourceManager().getBuffer(FID, + &Invalid); + if (Invalid) return true; EnterSourceFileWithLexer(new Lexer(FID, InputFile, *this), CurDir); |