зеркало из https://github.com/microsoft/clang.git
Guard in USRGenerator::GenLoc() against null Decl* from invalid code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130541 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
202e123d0d
Коммит
8c367589b6
|
@ -470,6 +470,12 @@ bool USRGenerator::GenLoc(const Decl *D) {
|
|||
if (generatedLoc)
|
||||
return IgnoreResults;
|
||||
generatedLoc = true;
|
||||
|
||||
// Guard against null declarations in invalid code.
|
||||
if (!D) {
|
||||
IgnoreResults = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
const SourceManager &SM = AU->getSourceManager();
|
||||
SourceLocation L = D->getLocStart();
|
||||
|
|
Загрузка…
Ссылка в новой задаче