Skip to content

Commit

Permalink
[NFC] Fix static analyzer concern
Browse files Browse the repository at this point in the history
Fix static analyzer concern about potential null value
dereference. findBackingIvar() dereferences Prop. PR
checks that Prop exists before calling the function.

Differential Revision: https://reviews.llvm.org/D157429
  • Loading branch information
elizabethandrews committed Aug 8, 2023
1 parent 34accad commit 6a4779c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/Analysis/BodyFarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ static Stmt *createObjCPropertyGetter(ASTContext &Ctx,

if (!IVar) {
Prop = MD->findPropertyDecl();
IVar = findBackingIvar(Prop);
IVar = Prop ? findBackingIvar(Prop) : nullptr;
}

if (!IVar || !Prop)
Expand Down

0 comments on commit 6a4779c

Please sign in to comment.