зеркало из 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
|
@ -471,6 +471,12 @@ bool USRGenerator::GenLoc(const Decl *D) {
|
||||||
return IgnoreResults;
|
return IgnoreResults;
|
||||||
generatedLoc = true;
|
generatedLoc = true;
|
||||||
|
|
||||||
|
// Guard against null declarations in invalid code.
|
||||||
|
if (!D) {
|
||||||
|
IgnoreResults = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
const SourceManager &SM = AU->getSourceManager();
|
const SourceManager &SM = AU->getSourceManager();
|
||||||
SourceLocation L = D->getLocStart();
|
SourceLocation L = D->getLocStart();
|
||||||
if (L.isInvalid()) {
|
if (L.isInvalid()) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче