Skip to content

Commit 7158fd0

Browse files
committed
[NFC] Fix potential nullptr dereference.
1 parent 0b2ab11 commit 7158fd0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clang-tools-extra/clang-tidy/readability/RedundantFunctionPtrDereferenceCheck.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ void RedundantFunctionPtrDereferenceCheck::registerMatchers(MatchFinder *Finder)
2525

2626
void RedundantFunctionPtrDereferenceCheck::check(const MatchFinder::MatchResult &Result) {
2727
const auto *Operator = Result.Nodes.getNodeAs<UnaryOperator>("op");
28+
assert(Operator && "Operator is null");
2829
diag(Operator->getOperatorLoc(),
2930
"redundant repeated dereference of function pointer")
3031
<< FixItHint::CreateRemoval(Operator->getOperatorLoc());

0 commit comments

Comments
 (0)