diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-09-18 12:11:16 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-09-18 12:11:16 +0000 |
commit | 557742540dfeebdedb0e6583ea0643ee919b8d73 (patch) | |
tree | 3c5ab4517ae42acce062d8b895a45deb05037cd2 /lib/AST | |
parent | 6803cc1958b56e0bd5a8139fd3252d5042ca37b9 (diff) | |
download | clang-557742540dfeebdedb0e6583ea0643ee919b8d73.tar.gz |
[AST] CommentLexer - Remove (optional) Invalid parameter from getSpelling.
The static analyzer noticed that we were dereferencing it even when the default null value was being used. Further investigation showed that we never explicitly set the parameter so I've just removed it entirely.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372217 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST')
-rw-r--r-- | lib/AST/CommentLexer.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/AST/CommentLexer.cpp b/lib/AST/CommentLexer.cpp index 19485f6018..c1ea3eab07 100644 --- a/lib/AST/CommentLexer.cpp +++ b/lib/AST/CommentLexer.cpp @@ -850,17 +850,14 @@ again: } StringRef Lexer::getSpelling(const Token &Tok, - const SourceManager &SourceMgr, - bool *Invalid) const { + const SourceManager &SourceMgr) const { SourceLocation Loc = Tok.getLocation(); std::pair<FileID, unsigned> LocInfo = SourceMgr.getDecomposedLoc(Loc); bool InvalidTemp = false; StringRef File = SourceMgr.getBufferData(LocInfo.first, &InvalidTemp); - if (InvalidTemp) { - *Invalid = true; + if (InvalidTemp) return StringRef(); - } const char *Begin = File.data() + LocInfo.second; return StringRef(Begin, Tok.getLength()); |