Skip to content

Commit

Permalink
[NFC] Avoid potential dereferencing of nullptr.
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D156274
  • Loading branch information
schittir committed Jul 31, 2023
1 parent 4a38995 commit 235390d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions clang/lib/AST/ItaniumMangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,7 @@ void CXXNameMangler::mangleUnqualifiedName(
// Otherwise, use the complete destructor name. This is relevant if a
// class with a destructor is declared within a destructor.
mangleCXXDtorType(Dtor_Complete);
assert(ND);
writeAbiTags(ND, AdditionalAbiTags);
break;

Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaCodeComplete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6601,7 +6601,7 @@ void Sema::CodeCompleteQualifiedId(Scope *S, CXXScopeSpec &SS,
// The "template" keyword can follow "::" in the grammar, but only
// put it into the grammar if the nested-name-specifier is dependent.
// FIXME: results is always empty, this appears to be dead.
if (!Results.empty() && NNS->isDependent())
if (!Results.empty() && NNS && NNS->isDependent())
Results.AddResult("template");

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

0 comments on commit 235390d

Please sign in to comment.