Skip to content

Commit 235390d

Browse files
committed
[NFC] Avoid potential dereferencing of nullptr.
Differential Revision: https://reviews.llvm.org/D156274
1 parent 4a38995 commit 235390d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

clang/lib/AST/ItaniumMangle.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,6 +1656,7 @@ void CXXNameMangler::mangleUnqualifiedName(
16561656
// Otherwise, use the complete destructor name. This is relevant if a
16571657
// class with a destructor is declared within a destructor.
16581658
mangleCXXDtorType(Dtor_Complete);
1659+
assert(ND);
16591660
writeAbiTags(ND, AdditionalAbiTags);
16601661
break;
16611662

clang/lib/Sema/SemaCodeComplete.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6601,7 +6601,7 @@ void Sema::CodeCompleteQualifiedId(Scope *S, CXXScopeSpec &SS,
66016601
// The "template" keyword can follow "::" in the grammar, but only
66026602
// put it into the grammar if the nested-name-specifier is dependent.
66036603
// FIXME: results is always empty, this appears to be dead.
6604-
if (!Results.empty() && NNS->isDependent())
6604+
if (!Results.empty() && NNS && NNS->isDependent())
66056605
Results.AddResult("template");
66066606

66076607
// If the scope is a concept-constrained type parameter, infer nested

0 commit comments

Comments
 (0)