Guard in USRGenerator::GenLoc() against null Decl* from invalid code.
llvm-svn: 130541
This commit is contained in:
parent
dd937843d3
commit
491da68ef9
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue