diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-16 22:30:13 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-16 22:30:13 +0000 |
commit | 453091cc2082e207ea2c2dda645a9bc01b37fb0c (patch) | |
tree | 96026d218bae429d6706d3783cd94e86b578dc47 /lib/Lex/Pragma.cpp | |
parent | a98c27ba83d25d878473ed8c6a34b40b27d323fd (diff) |
Audit all Preprocessor::getSpelling() callers, improving failure
recovery for those that need it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98689 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Pragma.cpp')
-rw-r--r-- | lib/Lex/Pragma.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp index 654d4606a9..92332a0068 100644 --- a/lib/Lex/Pragma.cpp +++ b/lib/Lex/Pragma.cpp @@ -287,7 +287,10 @@ void Preprocessor::HandlePragmaDependency(Token &DependencyTok) { // Reserve a buffer to get the spelling. llvm::SmallString<128> FilenameBuffer; - llvm::StringRef Filename = getSpelling(FilenameTok, FilenameBuffer); + bool Invalid = false; + llvm::StringRef Filename = getSpelling(FilenameTok, FilenameBuffer, &Invalid); + if (Invalid) + return; bool isAngled = GetIncludeFilenameSpelling(FilenameTok.getLocation(), Filename); |